Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 54171 Details for
Bug 164707
ArrayIndexOutOfBoundsException in JavaModelManager if source level == 6.0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 2.76 KB, created by
Frederic Fusier
on 2006-11-20 09:18:07 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2006-11-20 09:18:07 EST
Size:
2.76 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.builder >Index: src/org/eclipse/jdt/core/tests/builder/BasicBuildTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BasicBuildTests.java,v >retrieving revision 1.21 >diff -u -r1.21 BasicBuildTests.java >--- src/org/eclipse/jdt/core/tests/builder/BasicBuildTests.java 29 Mar 2006 03:16:23 -0000 1.21 >+++ src/org/eclipse/jdt/core/tests/builder/BasicBuildTests.java 20 Nov 2006 11:42:33 -0000 >@@ -19,6 +19,7 @@ > import org.eclipse.core.resources.IMarker; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IPath; >+import org.eclipse.jdt.core.IJavaProject; > import org.eclipse.jdt.core.JavaCore; > import org.eclipse.jdt.core.JavaModelException; > import org.eclipse.jdt.core.tests.util.Util; >@@ -402,4 +403,18 @@ > fullBuild(projectPath); > expectingNoProblems(); > } >+ >+ /** >+ * @bug 164707: ArrayIndexOutOfBoundsException in JavaModelManager if source level == 6.0 >+ * @test Ensure that AIIOB does not longer happen with invalid source level string >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=164707" >+ */ >+ public void testBug164707() throws JavaModelException { >+ IPath projectPath = env.addProject("Project"); //$NON-NLS-1$ >+ IJavaProject javaProject = env.getJavaProject(projectPath); >+ javaProject.setOption(JavaCore.COMPILER_SOURCE, "invalid"); >+ env.addExternalJars(projectPath, Util.getJavaClassLibs()); >+ fullBuild(projectPath); >+ expectingNoProblems(); >+ } > } >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/JavaModelManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java,v >retrieving revision 1.344 >diff -u -r1.344 JavaModelManager.java >--- model/org/eclipse/jdt/internal/core/JavaModelManager.java 6 Nov 2006 14:13:45 -0000 1.344 >+++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 20 Nov 2006 11:42:37 -0000 >@@ -329,7 +329,15 @@ > */ > private int indexForSourceLevel(String sourceLevel) { > if (sourceLevel == null) return 0; >- return sourceLevel.charAt(2) - 49; >+ int index = sourceLevel.charAt(2) - 49; >+ if (index < 0 || index > 5) { >+ // avoid AIIOB when source level is malformed (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=164707) >+ if (VERBOSE) { >+ System.out.println(sourceLevel+" is not a valid compiler source level (1.1 -> 1.6 expected)"); //$NON-NLS-1$ >+ } >+ return 0; >+ } >+ return index; > } > > private int sortParticipants(ArrayList group, IConfigurationElement[] configElements, int index) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 164707
:
54171
|
54183
|
54244
|
54255