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 91366 Details for
Bug 221110
[search] NPE at org.eclipse.jdt.internal.compiler.util.SimpleLookupTable.removeKey
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch + test
v01.txt (text/plain), 4.34 KB, created by
Frederic Fusier
on 2008-03-03 09:24:23 EST
(
hide
)
Description:
Proposed patch + test
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2008-03-03 09:24:23 EST
Size:
4.34 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java,v >retrieving revision 1.310 >diff -u -r1.310 MatchLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 26 Feb 2008 10:11:47 -0000 1.310 >+++ search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 3 Mar 2008 14:22:59 -0000 >@@ -2575,11 +2575,13 @@ > } > if (typeArgument instanceof Wildcard) { > TypeReference wildcardBound = ((Wildcard) typeArgument).bound; >- level = (Integer) nodeSet.matchingNodes.removeKey(wildcardBound); >- if (level != null) { >- IJavaElement localElement = createHandle(typeParameter, enclosingElement); >- this.patternLocator.matchReportReference(wildcardBound, enclosingElement, localElement, null, binding, level.intValue(), this); >- } >+ if (wildcardBound != null) { >+ level = (Integer) nodeSet.matchingNodes.removeKey(wildcardBound); >+ if (level != null) { >+ IJavaElement localElement = createHandle(typeParameter, enclosingElement); >+ this.patternLocator.matchReportReference(wildcardBound, enclosingElement, localElement, null, binding, level.intValue(), this); >+ } >+ } > } > } > } >@@ -2606,11 +2608,13 @@ > } > if (typeArgument instanceof Wildcard) { > TypeReference wildcardBound = ((Wildcard) typeArgument).bound; >- level = (Integer) nodeSet.matchingNodes.removeKey(wildcardBound); >- if (level != null) { >- IJavaElement localElement = createHandle(typeParameter, enclosingElement); >- this.patternLocator.matchReportReference(wildcardBound, enclosingElement, localElement, null, binding, level.intValue(), this); >- } >+ if (wildcardBound != null) { >+ level = (Integer) nodeSet.matchingNodes.removeKey(wildcardBound); >+ if (level != null) { >+ IJavaElement localElement = createHandle(typeParameter, enclosingElement); >+ this.patternLocator.matchReportReference(wildcardBound, enclosingElement, localElement, null, binding, level.intValue(), this); >+ } >+ } > } > } > } >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java,v >retrieving revision 1.145 >diff -u -r1.145 JavaSearchBugsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 26 Feb 2008 11:06:25 -0000 1.145 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 3 Mar 2008 14:23:01 -0000 >@@ -9743,4 +9743,29 @@ > "src/Bug.java Bug.{}:Inner#1.field [ §|Row|§ field;//LINE 3] EXACT_MATCH" > ); > } >+ >+/** >+ * @bug 221110: [search] NPE at org.eclipse.jdt.internal.compiler.util.SimpleLookupTable.removeKey >+ * @test Ensure that no NPE occurs while searching for reference to generic class >+ * when referenced in a unbound wildcard parameterized type >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=221110" >+ */ >+public void testBug221110() throws CoreException { >+ workingCopies = new ICompilationUnit[2]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/X.java", >+ "public class X<T> {\n" + >+ "}\n" >+ ); >+ workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/Y.java", >+ "public class Y<T extends X<?>> {\n" + >+ "}\n" >+ ); >+ this.resultCollector.showSelection = true; >+ this.resultCollector.showRule = true; >+ IType type = this.workingCopies[0].getType("X"); >+ search(type, REFERENCES, SearchPattern.R_ERASURE_MATCH, getJavaSearchWorkingCopiesScope(), this.resultCollector); >+ assertSearchResults( >+ "src/Y.java Y [public class Y<T extends §|X|§<?>> {] ERASURE_MATCH" >+ ); >+} > } >\ No newline at end of file
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 221110
:
91334
|
91355
|
91366
|
91380