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 54067 Details for
Bug 163984
[search] no results from SearchEngine.searchAllTypeNames with types in scope
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 4.51 KB, created by
Frederic Fusier
on 2006-11-17 07:32:47 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2006-11-17 07:32:47 EST
Size:
4.51 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.94 >diff -u -r1.94 JavaSearchBugsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 10 Nov 2006 21:40:37 -0000 1.94 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 16 Nov 2006 14:47:46 -0000 >@@ -7697,4 +7697,45 @@ > "src/A.java int A.x(int) [param] EXACT_MATCH" > ); > } >+ >+/** >+ * @bug 163984: [search] no results from SearchEngine.searchAllTypeNames with types in scope >+ * @test Ensure that types are found with scope made of elements >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=163984" >+ */ >+public void testONLY_Bug163984() throws CoreException { >+ // Search all type names with TypeNameMatchRequestor >+ TypeNameMatchCollector collector = new TypeNameMatchCollector() { >+ public String toString(){ >+ return toFullyQualifiedNamesString(); >+ } >+ }; >+ ICompilationUnit[] elements = getCompilationUnits("JavaSearchBugs", "src", "b163984"); >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements); >+ new SearchEngine().searchAllTypeNames( >+ null, >+ SearchPattern.R_EXACT_MATCH, >+ new char[] { '*' }, >+ SearchPattern.R_PATTERN_MATCH, >+ IJavaSearchConstants.TYPE, >+ scope, >+ collector, >+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >+ null); >+ // Search all type names with TypeNameRequestor >+ TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >+ new SearchEngine().searchAllTypeNames( >+ null, >+ SearchPattern.R_EXACT_MATCH, >+ new char[] { '*' }, >+ SearchPattern.R_PATTERN_MATCH, >+ IJavaSearchConstants.TYPE, >+ scope, >+ requestor, >+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >+ null); >+ // Should have same types with these 2 searches >+ assertEquals("We should get 3 types!", 3, collector.size()); >+ assertEquals("Found types sounds not to be correct", requestor.toString(), collector.toString()); >+} > } >\ No newline at end of file >Index: workspace/JavaSearchBugs/src/b163984/B.java >=================================================================== >RCS file: workspace/JavaSearchBugs/src/b163984/B.java >diff -N workspace/JavaSearchBugs/src/b163984/B.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ workspace/JavaSearchBugs/src/b163984/B.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,4 @@ >+package b163984; >+public class B { >+ public static void main(String[] args) {} >+} >Index: workspace/JavaSearchBugs/src/b163984/A.java >=================================================================== >RCS file: workspace/JavaSearchBugs/src/b163984/A.java >diff -N workspace/JavaSearchBugs/src/b163984/A.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ workspace/JavaSearchBugs/src/b163984/A.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,4 @@ >+package b163984; >+public class A { >+ public static void main(String[] args) {} >+} >Index: workspace/JavaSearchBugs/src/b163984/C.java >=================================================================== >RCS file: workspace/JavaSearchBugs/src/b163984/C.java >diff -N workspace/JavaSearchBugs/src/b163984/C.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ workspace/JavaSearchBugs/src/b163984/C.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,4 @@ >+package b163984; >+public class C { >+ public static void main(String[] args) {} >+} >#P org.eclipse.jdt.core >Index: search/org/eclipse/jdt/internal/core/search/JavaSearchScope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchScope.java,v >retrieving revision 1.52 >diff -u -r1.52 JavaSearchScope.java >--- search/org/eclipse/jdt/internal/core/search/JavaSearchScope.java 6 Oct 2006 17:43:34 -0000 1.52 >+++ search/org/eclipse/jdt/internal/core/search/JavaSearchScope.java 16 Nov 2006 14:47:49 -0000 >@@ -584,7 +584,8 @@ > } > Object target = JavaModel.getTarget(ResourcesPlugin.getWorkspace().getRoot(), new Path(this.containerPaths[index]+'/'+this.relativePaths[index]), false); > if (target instanceof IResource) { >- return project.getPackageFragmentRoot((IResource)target); >+ IJavaElement element = JavaCore.create((IResource)target); >+ return (IPackageFragmentRoot) element.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); > } > } > }
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 163984
: 54067