Community
Participate
Working Groups
Build ID: M20070212-1330 I can't compile a project. Their files were created by the Maven 2 plugin. I'm gettin this: java.lang.StringIndexOutOfBoundsException: String index out of range: 2 at java.lang.String.charAt(String.java:687) at org.eclipse.jdt.internal.core.JavaModelManager$CompilationParticipants.indexForSourceLevel(JavaModelManager.java:332) at org.eclipse.jdt.internal.core.JavaModelManager$CompilationParticipants.getCompilationParticipants(JavaModelManager.java:218) at org.eclipse.jdt.internal.core.builder.JavaBuilder.initializeBuilder(JavaBuilder.java:537) at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:165) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:603) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:167) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:230) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:233) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:252) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:285) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:154) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:217) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Sounds similar to bug 164707... Please attach the org.eclipse.jdt.core.prefs of this project (you'll find it in .settings directory) to confirm this assumption. Thanks
Philippe, sounds clear that we surely need to backport the fix for this bug...
My org.eclipse.jdt.core.prefs file was: org.eclipse.jdt.core.compiler.codegen.targetPlatform=6 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.source=6 org.eclipse.jdt.core.compiler.compliance=6 I've removed the project specific compiler settings and now everything works, thanks =).
Uhm, If I correctly read the patch at bug 164707, versionToJdkLevel() will fail to recognize "6.0" as a JDK1_6... Why not just do: if(versionID.startsWith("1.")) versionID = versionID.substring(2); ... and check agains "1", "2", "3"...
(In reply to comment #4) > Uhm, If I correctly read the patch at bug 164707, versionToJdkLevel() will fail > to recognize "6.0" as a JDK1_6... > > Why not just do: > > if(versionID.startsWith("1.")) > versionID = versionID.substring(2); > > ... and check agains "1", "2", "3"... > The bug is in Maven as they directly modify the org.eclipse.jdt.core.prefs file instead of using API methods of IJavaProject... As these values are internal, for obvious performance reason, we're *only* expecting them and do not want to accept/verify all possible ones... Sorry for the late answer but close this bug as WONTFIX
Use API to modify org.eclipse.jdt.core.prefs file Verified for 3.4 M2 using build I20070917-0010.