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 187170 Details for
Bug 334119
AIOOBE in BindingKeyParser.parseInnerType (was: Copy Qualified Name throws ArrayIndexOutOfBoundsException)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
proposed fix + regression tests
patch334119.txt (text/plain), 4.33 KB, created by
Ayushman Jain
on 2011-01-20 04:43:26 EST
(
hide
)
Description:
proposed fix + regression tests
Filename:
MIME Type:
Creator:
Ayushman Jain
Created:
2011-01-20 04:43:26 EST
Size:
4.33 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java,v >retrieving revision 1.186 >diff -u -r1.186 SourceTypeBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 16 Jan 2011 22:43:21 -0000 1.186 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 20 Jan 2011 09:42:16 -0000 >@@ -639,7 +639,12 @@ > start = CharOperation.lastIndexOf('/', uniqueKey) + 1; > if (start == 0) > start = 1; // start after L >- end = CharOperation.indexOf('$', uniqueKey, start); >+ if (this.isMemberType()) { >+ end = CharOperation.indexOf('$', uniqueKey, start); >+ } else { >+ // '$' is part of the type name >+ end = -1; >+ } > if (end == -1) > end = CharOperation.indexOf('<', uniqueKey, start); > if (end == -1) >Index: model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java,v >retrieving revision 1.41 >diff -u -r1.41 BindingKeyParser.java >--- model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java 18 Mar 2010 16:18:58 -0000 1.41 >+++ model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java 20 Jan 2011 09:42:16 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2010 IBM Corporation and others. >+ * Copyright (c) 2005, 2011 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -731,6 +731,9 @@ > if (!this.scanner.isAtMemberTypeStart() || this.scanner.nextToken() != Scanner.TYPE) > return; > char[] typeName = this.scanner.getTokenSource(); >+ // Might not actually be an inner type but came here as a consequence of '$' being present in type name >+ if (typeName.length == 0) >+ return; > if (Character.isDigit(typeName[0])) { > // anonymous or local type > int nextToken = Scanner.TYPE; >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java,v >retrieving revision 1.301 >diff -u -r1.301 ASTConverter15Test.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 7 Jan 2011 15:10:22 -0000 1.301 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 20 Jan 2011 09:42:18 -0000 >@@ -11200,4 +11200,40 @@ > assertNotNull("No binding", binding); > assertEquals("Wrong qualified name", "test0347.Outer<java.lang.Integer>", binding.getQualifiedName()); > } >-} >\ No newline at end of file >+ >+ /* >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=334119 >+ * Ensures that dollar in a type name is not confused as the starting of member type >+ */ >+ public void test0348a() throws JavaModelException { >+ this.workingCopy = getWorkingCopy("/Converter15/src/p/X$Y.java", true/*resolve*/); >+ ASTNode node = buildAST( >+ "package p;\n" + >+ "/*start*/public class X$Y {\n" + >+ "}/*end*/", >+ this.workingCopy, >+ false); >+ IBinding binding = ((TypeDeclaration) node).resolveBinding(); >+ assertBindingKeyEquals( >+ "Lp/X$Y;", // should not be Lp/X$Y-X$Y; >+ binding.getKey()); >+ } >+ >+ /* >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=334119 >+ * Ensures that dollar in a type name is not confused as the starting of member type >+ */ >+ public void test0348b() throws JavaModelException { >+ this.workingCopy = getWorkingCopy("/Converter15/src/p/X$.java", true/*resolve*/); >+ ASTNode node = buildAST( >+ "package p;\n" + >+ "/*start*/public class X$ {\n" + >+ "}/*end*/", >+ this.workingCopy, >+ false); >+ IBinding binding = ((TypeDeclaration) node).resolveBinding(); >+ assertBindingKeyEquals( >+ "Lp/X$;", // should not be Lp/X$~X$; >+ binding.getKey()); >+ } >+}
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 334119
:
186715
| 187170