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 167470 Details for
Bug 157847
NPE in WildcardBinding.computeUniqueKey during code assist
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
patch.txt (text/plain), 3.75 KB, created by
Srikanth Sankaran
on 2010-05-07 09:31:47 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2010-05-07 09:31:47 EDT
Size:
3.75 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java,v >retrieving revision 1.105 >diff -u -r1.105 LookupEnvironment.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java 9 Feb 2010 05:14:15 -0000 1.105 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java 7 May 2010 13:06:45 -0000 >@@ -905,6 +905,9 @@ > // cached info is array of already created wildcard types for this type > if (genericType == null) // pseudo wildcard denoting composite bounds for lub computation > genericType = ReferenceBinding.LUB_GENERIC; >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=157847 don't allow '? super <null>' or '? extends <null>' >+ if (bound == null && boundKind != Wildcard.UNBOUND) >+ return null; > WildcardBinding[] cachedInfo = (WildcardBinding[])this.uniqueWildcardBindings.get(genericType); > boolean needToGrow = false; > int index = 0; >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java,v >retrieving revision 1.63 >diff -u -r1.63 ASTModelBridgeTests.java >--- src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java 14 Dec 2009 18:46:07 -0000 1.63 >+++ src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java 7 May 2010 13:06:50 -0000 >@@ -2133,5 +2133,65 @@ > element > ); > } >+ /** >+ * Ensures that we don't create internally inconsistent wildcard >+ * bindings of the form '? extends <null>' or '? super <null>' >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=157847" >+ */ >+ public void testWildcard2() throws CoreException { >+ String filePath = "/P/src/Bug157847.java"; >+ try { >+ String contents = >+ "public class Bug157847<T> {\n" + >+ " void add(Y<? super T> l) {}\n" + >+ "}\n"+ >+ "interface Y<T> {}\n"; >+ createFile(filePath, contents); >+ >+ BindingRequestor requestor = new BindingRequestor(); >+ String[] bindingKeys = new String[] {"LBug157847~Y<LBug157847~Y;{0}-!LBug157847;{0}*54;>;"}; >+ resolveASTs( >+ new ICompilationUnit[] {}, >+ bindingKeys, >+ requestor, >+ getJavaProject("P"), >+ this.workingCopy.getOwner() >+ ); >+ IBinding[] bindings = requestor.getBindings(bindingKeys); >+ assertTrue("Constructed bogus wildcard", bindings.length == 0); >+ } finally { >+ deleteFile(filePath); >+ } >+ } >+ /** >+ * Ensures that we don't create internally inconsistent wildcard >+ * bindings of the form '? extends <null>' or '? super <null>' >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=157847" >+ */ >+ public void testWildcard3() throws CoreException { >+ String filePath = "/P/src/Bug157847B.java"; >+ try { >+ String contents = >+ "public class Bug157847B<T> {\n" + >+ " void add(Y<? extends T> l) {}\n" + >+ "}\n"+ >+ "interface Y<T> {}\n"; >+ createFile(filePath, contents); >+ >+ BindingRequestor requestor = new BindingRequestor(); >+ String[] bindingKeys = new String[] {"LBug157847B~Y<LBug157847B~Y;{0}+!LBug157847B;{0}*54;>;"}; >+ resolveASTs( >+ new ICompilationUnit[] {}, >+ bindingKeys, >+ requestor, >+ getJavaProject("P"), >+ this.workingCopy.getOwner() >+ ); >+ IBinding[] bindings = requestor.getBindings(bindingKeys); >+ assertTrue("Constructed bogus wildcard", bindings.length == 0); >+ } finally { >+ deleteFile(filePath); >+ } >+ } > > }
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 157847
:
167470
|
167664
|
167718