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 202886 Details for
Bug 355605
NPE in HierarchyResolver
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch with test
bug_355605.txt (text/plain), 3.42 KB, created by
Jay Arthanareeswaran
on 2011-09-07 08:08:32 EDT
(
hide
)
Description:
Patch with test
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2011-09-07 08:08:32 EDT
Size:
3.42 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java,v >retrieving revision 1.95 >diff -u -r1.95 HierarchyResolver.java >--- model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java 28 Jul 2011 17:07:39 -0000 1.95 >+++ model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java 7 Sep 2011 12:05:15 -0000 >@@ -846,6 +846,8 @@ > char[][] memberTypeNames = CharOperation.splitOn('$', typeName, firstDollar+1, typeName.length); > for (int i = 0; i < memberTypeNames.length; i++) { > this.focusType = this.focusType.getMemberType(memberTypeNames[i]); >+ if (this.focusType == null) >+ return this.focusType; > } > } > } >#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.222 >diff -u -r1.222 JavaSearchBugsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 24 Aug 2011 10:59:29 -0000 1.222 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 7 Sep 2011 12:05:38 -0000 >@@ -710,6 +710,7 @@ > suite.addTest(new JavaSearchBugsTests("testBug350885")); > suite.addTest(new JavaSearchBugsTests("testBug349683")); > suite.addTest(new JavaSearchBugsTests("testBug345807")); >+ suite.addTest(new JavaSearchBugsTests("testBug355605")); > return suite; > } > class TestCollector extends JavaSearchResultCollector { >@@ -13713,4 +13714,44 @@ > deleteProject("Project2"); > } > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=355605 >+public void testBug355605() throws CoreException { >+ try { >+ IJavaProject project = createJavaProject("P"); >+ >+ String fileContent = >+ "public class X { \n" >+ + "class R {\n" >+ + " class S {\n" >+ + " void setInfo(String x) {\n" >+ + " }\n" >+ + " }\n" >+ + " class T {\n" >+ + " }\n" >+ + " T t = new T() {\n" >+ + " S s = new S() {\n" >+ + " void myMethod() {\n" >+ + " setInfo(\"a\");\n" >+ + " }\n" >+ + " };// S ends\n" >+ + " };\n" >+ + "}\n" >+ + "}\n" ; >+ createFile("/P/X.java", fileContent); >+ >+ waitUntilIndexesReady(); >+ this.resultCollector = new TestCollector(); >+ this.resultCollector.showAccuracy(true); >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[]{project}, IJavaSearchScope.SOURCES); >+ search("setInfo", METHOD, IMPLEMENTORS, EXACT_RULE, scope, this.resultCollector); >+ IMethod method = (IMethod) ((SearchMatch)((TestCollector)this.resultCollector).matches.get(0)).getElement(); >+ this.resultCollector = new TestCollector(); >+ IJavaSearchScope hierarchyScope = SearchEngine.createHierarchyScope((IType)method.getParent()); >+ search(method, IMPLEMENTORS, ERASURE_RULE, hierarchyScope, this.resultCollector); >+ assertSearchResults("Unexpected search results!", "X.java void X$R.t:<anonymous>#1.s:<anonymous>#1.myMethod() [myMethod]", this.resultCollector); >+ >+ } finally { >+ deleteProject("P"); >+ } >+} > } >\ 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 355605
:
202401
| 202886