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 45161 Details for
Bug 148215
[search] Exception while searching for declarations of referenced types in binary java elements packaged in a jar
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v01.txt (text/plain), 4.61 KB, created by
Frederic Fusier
on 2006-06-23 07:01:36 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2006-06-23 07:01:36 EDT
Size:
4.61 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#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.76.2.2 >diff -u -r1.76.2.2 JavaSearchBugsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 31 May 2006 17:39:26 -0000 1.76.2.2 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 23 Jun 2006 10:54:00 -0000 >@@ -6638,4 +6638,55 @@ > "lib/b140156.jar void X.foo(List<T>) [No source] EXACT_MATCH" > ); > } >+ >+/** >+ * Bug 148215: [search] correct results are missing in java search >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=148215" >+ */ >+public void testBug148215_Types() throws CoreException { >+ addLibraryEntry(JAVA_PROJECT, "/JavaSearchBugs/lib/b148215.jar", false); >+ try { >+ IType type = getClassFile("JavaSearchBugs", "lib/b148215.jar", "test.pack", "Test.class").getType(); >+ IMethod method = type.getMethods()[1]; >+ searchDeclarationsOfReferencedTypes(method, this.resultCollector); >+ assertSearchResults( >+ ""+ getExternalJCLPathString("1.5") + " java.lang.Object EXACT_MATCH\n" + >+ ""+ getExternalJCLPathString("1.5") + " java.lang.String EXACT_MATCH\n" + >+ "lib/b148215.jar test.def.Reference EXACT_MATCH" >+ ); >+ } >+ finally { >+ removeLibraryEntry(JAVA_PROJECT, new Path("/JavaSearchBugs/lib/b148215.jar")); >+ } >+} >+public void testBug148215_Messages() throws CoreException { >+ addLibraryEntry(JAVA_PROJECT, "/JavaSearchBugs/lib/b148215.jar", false); >+ try { >+ IType type = getClassFile("JavaSearchBugs", "lib/b148215.jar", "test.pack", "Test.class").getType(); >+ IMethod method = type.getMethods()[1]; >+ searchDeclarationsOfSentMessages(method, this.resultCollector); >+ assertSearchResults( >+ "lib/b148215.jar void test.pack.Test.bar(java.lang.String) EXACT_MATCH\n" + >+ "lib/b148215.jar void test.pack.Test.bar(test.def.Reference) EXACT_MATCH" >+ ); >+ } >+ finally { >+ removeLibraryEntry(JAVA_PROJECT, new Path("/JavaSearchBugs/lib/b148215.jar")); >+ } >+} >+public void testBug148215_Fields() throws CoreException { >+ addLibraryEntry(JAVA_PROJECT, "/JavaSearchBugs/lib/b148215.jar", false); >+ try { >+ IType type = getClassFile("JavaSearchBugs", "lib/b148215.jar", "test.pack", "Test.class").getType(); >+ IMethod method = type.getMethods()[1]; >+ searchDeclarationsOfAccessedFields(method, this.resultCollector); >+ assertSearchResults( >+ "lib/b148215.jar test.pack.Test.sField EXACT_MATCH\n" + >+ "lib/b148215.jar test.pack.Test.rField EXACT_MATCH" >+ ); >+ } >+ finally { >+ removeLibraryEntry(JAVA_PROJECT, new Path("/JavaSearchBugs/lib/b148215.jar")); >+ } >+} > } >#P org.eclipse.jdt.core >Index: search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java,v >retrieving revision 1.34 >diff -u -r1.34 BasicSearchEngine.java >--- search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java 18 Apr 2006 16:28:18 -0000 1.34 >+++ search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java 23 Jun 2006 10:54:04 -0000 >@@ -319,20 +319,7 @@ > } > return this.parser; > } >- >- /* >- * Returns the underlying resource of the given element. >- */ >- private IResource getResource(IJavaElement element) { >- if (element instanceof IMember) { >- ICompilationUnit cu = ((IMember)element).getCompilationUnit(); >- if (cu != null) { >- return cu.getResource(); >- } >- } >- return element.getResource(); >- } >- >+ > /* > * Returns the list of working copies used by this search engine. > * Returns null if none. >@@ -1091,7 +1078,18 @@ > Util.verbose(" - java element: "+enclosingElement); //$NON-NLS-1$ > } > IJavaSearchScope scope = createJavaSearchScope(new IJavaElement[] {enclosingElement}); >- IResource resource = this.getResource(enclosingElement); >+ IResource resource = enclosingElement.getResource(); >+ if (enclosingElement instanceof IMember) { >+ IMember member = (IMember) enclosingElement; >+ ICompilationUnit cu = member.getCompilationUnit(); >+ if (cu != null) { >+ resource = cu.getResource(); >+ } else if (member.isBinary()) { >+ // binary member resource cannot be used as this >+ // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=148215 >+ resource = null; >+ } >+ } > try { > if (resource instanceof IFile) { > try {
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 148215
:
45160
| 45161