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 51770 Details for
Bug 160323
[search] TypeNameMatch: support hashCode/equals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 23.08 KB, created by
Frederic Fusier
on 2006-10-11 13:06:38 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2006-10-11 13:06:38 EDT
Size:
23.08 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java,v >retrieving revision 1.8 >diff -u -r1.8 MultiTypeDeclarationPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java 7 Sep 2006 12:59:26 -0000 1.8 >+++ search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java 11 Oct 2006 15:44:15 -0000 >@@ -83,10 +83,15 @@ > if (this.qualifications != null) { > int count = 0; > int max = this.qualifications.length; >- for (; count < max; count++) >- if (matchesName(this.qualifications[count], pattern.qualification)) >- break; >- if (count == max) return false; >+ if (max == 0 && pattern.qualification.length > 0) { >+ return false; >+ } >+ if (max > 0) { >+ for (; count < max; count++) >+ if (matchesName(this.qualifications[count], pattern.qualification)) >+ break; >+ if (count == max) return false; >+ } > } > > // chekc simple name >Index: search/org/eclipse/jdt/core/search/SearchEngine.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchEngine.java,v >retrieving revision 1.133 >diff -u -r1.133 SearchEngine.java >--- search/org/eclipse/jdt/core/search/SearchEngine.java 6 Oct 2006 17:43:34 -0000 1.133 >+++ search/org/eclipse/jdt/core/search/SearchEngine.java 11 Oct 2006 15:44:14 -0000 >@@ -774,9 +774,9 @@ > * and type names in a case sensitive way. > * > * @param qualifications the qualified name of the package/enclosing type of the searched types. >- * May be <code>null</code>, then any package name is accepted. >+ * If this parameter is <code>null</code>, then no type will be found. > * @param typeNames the simple names of the searched types. >- * May be <code>null</code>, then any type name is accepted. >+ * If this parameter is <code>null</code>, then no type will be found. > * @param scope the scope to search in > * @param nameRequestor the requestor that collects the results of the search > * @param waitingPolicy one of >@@ -816,6 +816,57 @@ > } > > /** >+ * Searches for all top-level types and member types in the given scope matching any of the given qualifications >+ * and type names in a case sensitive way. >+ * <p> >+ * Provided {@link TypeNameMatchRequestor} requestor will collect {@link TypeNameMatch} >+ * matches found during the search. >+ * </p> >+ * >+ * @param qualifications the qualified name of the package/enclosing type of the searched types. >+ * If this parameter is <code>null</code>, then no type will be found. >+ * @param typeNames the simple names of the searched types. >+ * If this parameter is <code>null</code>, then no type will be found. >+ * @param scope the scope to search in >+ * @param nameMatchRequestor the {@link TypeNameMatchRequestor requestor} that collects >+ * {@link TypeNameMatch matches} of the search. >+ * @param waitingPolicy one of >+ * <ul> >+ * <li>{@link IJavaSearchConstants#FORCE_IMMEDIATE_SEARCH} if the search should start immediately</li> >+ * <li>{@link IJavaSearchConstants#CANCEL_IF_NOT_READY_TO_SEARCH} if the search should be cancelled if the >+ * underlying indexer has not finished indexing the workspace</li> >+ * <li>{@link IJavaSearchConstants#WAIT_UNTIL_READY_TO_SEARCH} if the search should wait for the >+ * underlying indexer to finish indexing the workspace</li> >+ * </ul> >+ * @param progressMonitor the progress monitor to report progress to, or <code>null</code> if no progress >+ * monitor is provided >+ * @exception JavaModelException if the search failed. Reasons include: >+ * <ul> >+ * <li>the classpath is incorrectly set</li> >+ * </ul> >+ * @since 3.3 >+ */ >+ public void searchAllTypeNames( >+ final char[][] qualifications, >+ final char[][] typeNames, >+ IJavaSearchScope scope, >+ final TypeNameMatchRequestor nameMatchRequestor, >+ int waitingPolicy, >+ IProgressMonitor progressMonitor) throws JavaModelException { >+ >+ TypeNameMatchRequestorWrapper requestorWrapper = new TypeNameMatchRequestorWrapper(nameMatchRequestor, scope); >+ this.basicEngine.searchAllTypeNames( >+ qualifications, >+ typeNames, >+ SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE, >+ IJavaSearchConstants.TYPE, >+ scope, >+ requestorWrapper, >+ waitingPolicy, >+ progressMonitor); >+ } >+ >+ /** > * Searches for all top-level types and member types in the given scope. > * The search can be selecting specific types (given a package or a type name > * prefix and match modes). >Index: search/org/eclipse/jdt/core/search/TypeNameMatch.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeNameMatch.java,v >retrieving revision 1.2 >diff -u -r1.2 TypeNameMatch.java >--- search/org/eclipse/jdt/core/search/TypeNameMatch.java 6 Oct 2006 17:43:34 -0000 1.2 >+++ search/org/eclipse/jdt/core/search/TypeNameMatch.java 11 Oct 2006 15:44:14 -0000 >@@ -10,10 +10,8 @@ > *******************************************************************************/ > package org.eclipse.jdt.core.search; > >-import org.eclipse.jdt.core.IJavaElement; >-import org.eclipse.jdt.core.IPackageFragmentRoot; >-import org.eclipse.jdt.core.IType; >-import org.eclipse.jdt.core.JavaModelException; >+import org.eclipse.core.runtime.Assert; >+import org.eclipse.jdt.core.*; > > /** > * A match collected while searching for all type names using >@@ -41,44 +39,26 @@ > /** > * Creates a new type name match. > */ >-public TypeNameMatch(IType type) { >- this.type = type; >-} >- > public TypeNameMatch(IType type, int modifiers) { >- this(type); >+ Assert.isNotNull(type, "Type cannot be null for a name match!"); //$NON-NLS-1$ >+ this.type = type; > this.modifiers = modifiers; > } > > /** >- * Returns the java model type corresponding to fully qualified type name (based >- * on package, enclosing types and simple name). >- * >- * @return the java model type >- * @throws JavaModelException >- * happens when type stored information are not valid >+ * Returns whether the stored type is equals to given object or not. > */ >-public IType getType() throws JavaModelException { >- return this.type; >-} >- >-/* >- * (non-Javadoc) >- * >- * @see java.lang.Object#toString() >- */ >-public String toString() { >- return this.type.toString(); >-} >- >-public IPackageFragmentRoot getPackageFragmentRoot() { >- return (IPackageFragmentRoot) this.type.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); >+public boolean equals(Object obj) { >+ if (obj == null) return false; >+ return this.type.equals(obj); > } > > /** >- * Fully qualified name of type (e.g. package name + '.' enclosing type names + >- * '.' simple name) >+ * Returns the fully qualified name of stored type >+ * (e.g. package name + '.' enclosing type names + '.' simple name) > * >+ * @see #getType() >+ * @see IType#getFullyQualifiedName(char) > * @return Fully qualified type name of the type > */ > public String getFullyQualifiedName() { >@@ -86,27 +66,33 @@ > } > > /** >- * Fully qualified name of type (e.g. package name + '.' enclosing type names + >- * '.' simple name) >+ * Returns the stored modifiers of the type. >+ * This is a handle-only method. > * >- * @return Fully qualified type name of the type >+ * @return the type modifiers > */ >-public String getTypeQualifiedName() { >- return this.type.getTypeQualifiedName('.'); >+public int getModifiers() { >+ return this.modifiers; > } > > /** >- * Returns the modifiers of the type. >+ * Returns the package fragment root of the stored type. >+ * Package fragment root cannot be null and <strong>does</strong> exist. > * >- * @return the type modifiers >+ * @see #getType() >+ * @see IJavaElement#getAncestor(int) >+ * @return the existing java model package fragment root (ie. cannot be <code>null</code> >+ * and will return <code>true</code> to <code>exists()</code> message). > */ >-public int getModifiers() { >- return this.modifiers; >+public IPackageFragmentRoot getPackageFragmentRoot() { >+ return (IPackageFragmentRoot) this.type.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); > } > > /** >- * Returns the package name of the type. >+ * Returns the package name of the stored type. > * >+ * @see #getType() >+ * @see IType#getPackageFragment() > * @return the package name > */ > public String getPackageName() { >@@ -114,8 +100,10 @@ > } > > /** >- * Returns the name of the type. >+ * Returns the name of the stored type. > * >+ * @see #getType() >+ * @see IJavaElement#getElementName() > * @return the type name > */ > public String getSimpleTypeName() { >@@ -123,8 +111,23 @@ > } > > /** >- * Name of the type container (e.g. enclosing type names + '.' + simple name) >+ * Returns the stored java model type. As this match was built while searching >+ * for all types in index files, the stored type cannot be null and does exist. >+ * This is a handle-only method. >+ * >+ * @see IType >+ * @return the existing java model type (ie. cannot be <code>null</code> >+ * and will return <code>true</code> to <code>exists()</code> message). >+ */ >+public IType getType() { >+ return this.type; >+} >+ >+/** >+ * Name of the type container (e.g. enclosing type names + '.' + simple name). > * >+ * @see #getType() >+ * @see IMember#getDeclaringType() > * @return Name of the type container > */ > public String getTypeContainerName() { >@@ -135,4 +138,30 @@ > return this.type.getPackageFragment().getElementName(); > } > } >+ >+/** >+ * Returns the qualified name of type >+ * (e.g. enclosing type names + '.' simple name). >+ * >+ * @see #getType() >+ * @see IType#getTypeQualifiedName(char) >+ * @return Fully qualified type name of the type >+ */ >+public String getTypeQualifiedName() { >+ return this.type.getTypeQualifiedName('.'); >+} >+ >+/** >+ * Returns stored type hashCode. >+ */ >+public int hashCode() { >+ return this.type.hashCode(); >+} >+ >+/** >+ * Returns stored type string. >+ */ >+public String toString() { >+ return this.type.toString(); >+} > } >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.40 >diff -u -r1.40 BasicSearchEngine.java >--- search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java 6 Oct 2006 17:43:34 -0000 1.40 >+++ search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java 11 Oct 2006 15:44:15 -0000 >@@ -809,7 +809,7 @@ > } > if (match(typeSuffix, packageName, typeName, typeMatchRule, kind, packageDeclaration, simpleName)) { > if (nameRequestor instanceof TypeNameMatchRequestorWrapper) { >- ((TypeNameMatchRequestorWrapper)nameRequestor).requestor.acceptTypeNameMatch(new TypeNameMatch(type)); >+ ((TypeNameMatchRequestorWrapper)nameRequestor).requestor.acceptTypeNameMatch(new TypeNameMatch(type, type.getFlags())); > } else { > nameRequestor.acceptType(type.getFlags(), packageDeclaration, simpleName, enclosingTypeNames, path, null); > } >Index: buildnotes_jdt-core.html >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/buildnotes_jdt-core.html,v >retrieving revision 1.5458 >diff -u -r1.5458 buildnotes_jdt-core.html >--- buildnotes_jdt-core.html 11 Oct 2006 15:11:50 -0000 1.5458 >+++ buildnotes_jdt-core.html 11 Oct 2006 15:44:13 -0000 >@@ -51,8 +51,48 @@ > <br>Project org.eclipse.jdt.core v_717 > (<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/?only_with_tag=v_717">cvs</a>). > <h2>What's new in this drop</h2> >+<ul> >+<li>Added new <code>SearchEngine</code> API method for search all type names with multiple qualifications and type names >+(see bug <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=160324">160324</a>).<br> >+Only requestor differs from already existing corresponding <code>searchAllTypeNames</code> method: >+<pre> >+/** >+ * Searches for all top-level types and member types in the given scope matching any of the given qualifications >+ * and type names in a case sensitive way. >+ * >+ * Provided {@link TypeNameMatchRequestor} requestor will collect {@link TypeNameMatch} >+ * matches found during the search. >+... >+ * @param nameMatchRequestor the {@link TypeNameMatchRequestor requestor} that collects >+ * {@link TypeNameMatch matches} of the search. >+... >+ * @since 3.3 >+ */ >+public void searchAllTypeNames( >+ final char[][] qualifications, >+ final char[][] typeNames, >+ IJavaSearchScope scope, >+ final TypeNameMatchRequestor nameMatchRequestor, >+ int waitingPolicy, >+ IProgressMonitor progressMonitor) throws JavaModelException >+</pre> >+Similarily to previous added <code>searchAllTypeNames</code> new API method, clients have to provide >+a new requestor: <code>TypeNameMatchRequestor</code> in order to get matches collected during the search. >+</li> >+</ul> > > <h3>Problem Reports Fixed</h3> >+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=160494">160494</a> >+[search] searchAllTypeNames(char[][], char[][],...) fails to find types in default package >+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=160328">160328</a> >+[search] Remove constructor TypeNameMatch(IType) >+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=160327">160327</a> >+[search] Add specification for TypeNameMatch.getType >+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=160324">160324</a> >+[search] SearchEngine.searchAllTypeNames(char[][], char[][], TypeNameMatchRequestor >+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=160323">160323</a> >+[search] TypeNameMatch: support hashCode/equals >+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=160352">160352</a> > <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=90600">90600</a> > [model] CreateElementInCUOperation.apply: should use project options for rewriter > <br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=160352">160352</a> >#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.89 >diff -u -r1.89 JavaSearchBugsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 10 Oct 2006 10:33:02 -0000 1.89 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 11 Oct 2006 15:44:19 -0000 >@@ -85,34 +85,45 @@ > } > > class TypeNameMatchCollector extends TypeNameMatchRequestor { >- private int index = -1; >- public String[] results = new String[10]; >+ List matches = new ArrayList(); > public void acceptTypeNameMatch(TypeNameMatch match) { >- int length = results.length; >- if (++index > length) { >- System.arraycopy(results, 0, results = new String[length+10], 0, length); >+ IType type = match.getType(); >+ if (type != null) { >+ this.matches.add(type); > } >- try { >- IType type = match.getType(); >- if (type != null) { >- results[index] = type.toString(); >+ } >+ public int size() { >+ return this.matches.size(); >+ } >+ private String toString(int kind) { >+ int size = size(); >+ if (size == 0) return ""; >+ String[] strings = new String[size]; >+ for (int i=0; i<size; i++) { >+ IType type = (IType) this.matches.get(i); >+ switch (kind) { >+ case 1: // fully qualified name >+ strings[i] = type.getFullyQualifiedName(); >+ break; >+ case 0: >+ default: >+ strings[i] = type.toString(); > } > } >- catch (JavaModelException jme) { >- assertTrue("We should not have any JavaModel exception! Message:"+jme.getMessage(), false); >- } >- } >- public String toString() { >- String[] strings = new String[index+1]; >- System.arraycopy(results, 0, strings, 0, index+1); > Arrays.sort(strings); > StringBuffer buffer = new StringBuffer(); >- for (int i=0; i<=index; i++) { >+ for (int i=0; i<size; i++) { > if (i>0) buffer.append('\n'); > buffer.append(strings[i]); > } > return buffer.toString(); > } >+ public String toString() { >+ return toString(0); >+ } >+ public String toFullyQualifiedNamesString() { >+ return toString(1); >+ } > } > IJavaSearchScope getJavaSearchScopeBugs() { > return SearchEngine.createJavaSearchScope(new IJavaProject[] {getJavaProject("JavaSearchBugs")}); >@@ -7145,4 +7156,160 @@ > ); > } > >+/** >+ * @bug 160323: [search] TypeNameMatch: support hashCode/equals >+ * @test Ensure that match equals and hashCode methods return same values than those of stored {@link IType}. >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=160323" >+ */ >+public void testBug160323() throws CoreException { >+ // Search all type names with TypeNameMatchRequestor >+ TypeNameMatchCollector collector = new TypeNameMatchCollector() { >+ public void acceptTypeNameMatch(TypeNameMatch match) { >+ assertTrue("Problem with equals method for match "+match, match.equals(match.getType())); >+ assertEquals("Problem with hashCode method for match "+match, match.getType().hashCode(), match.hashCode()); >+ super.acceptTypeNameMatch(match); >+ } >+ public String toString(){ >+ return toFullyQualifiedNamesString(); >+ } >+ }; >+ new SearchEngine().searchAllTypeNames( >+ null, >+ SearchPattern.R_EXACT_MATCH, >+ null, >+ SearchPattern.R_PREFIX_MATCH, >+ IJavaSearchConstants.TYPE, >+ getJavaSearchScopeBugs(), >+ 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, >+ null, >+ SearchPattern.R_PREFIX_MATCH, >+ IJavaSearchConstants.TYPE, >+ getJavaSearchScopeBugs(), >+ requestor, >+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >+ null); >+ // Should have same types with these 2 searches >+ assertTrue("We should get some types!", collector.size() > 0); >+ assertEquals("Found types sounds not to be correct", requestor.toString(), collector.toString()); >+} >+/** >+ * @bug 160324: [search] SearchEngine.searchAllTypeNames(char[][], char[][], TypeNameMatchRequestor >+ * @test Ensure that types found using {@link SearchEngine#searchAllTypeNames(char[][], char[][], IJavaSearchScope, TypeNameMatchRequestor, int, org.eclipse.core.runtime.IProgressMonitor) new API method} >+ * are the same than with already existing API method using {@link TypeNameRequestor}... >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=160324" >+ */ >+public void testBug160324a() throws CoreException { >+ // Search all type names with new API >+ TypeNameMatchCollector collector = new TypeNameMatchCollector() { >+ public void acceptTypeNameMatch(TypeNameMatch match) { >+ assertTrue("Problem with equals method for match "+match, match.equals(match.getType())); >+ assertEquals("Problem with hashCode method for match "+match, match.getType().hashCode(), match.hashCode()); >+ super.acceptTypeNameMatch(match); >+ } >+ public String toString(){ >+ return toFullyQualifiedNamesString(); >+ } >+ }; >+ new SearchEngine().searchAllTypeNames( >+ null, >+ null, >+ getJavaSearchScopeBugs(), >+ collector, >+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >+ null); >+ assertEquals("We should not find any type", "", collector.toString()); >+ // Search all type names with old API >+ TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >+ new SearchEngine().searchAllTypeNames( >+ null, >+ null, >+ getJavaSearchScopeBugs(), >+ requestor, >+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >+ null); >+ assertEquals("We should not find any type", "", requestor.toString()); >+} >+public void testBug160324b() throws CoreException { >+ // Search all type names with new API >+ TypeNameMatchCollector collector = new TypeNameMatchCollector() { >+ public String toString(){ >+ return toFullyQualifiedNamesString(); >+ } >+ }; >+ new SearchEngine().searchAllTypeNames( >+ null, >+ new char[][] { "Test".toCharArray() }, >+ getJavaSearchScopeBugs(), >+ collector, >+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >+ null); >+ // Search all type names with old API >+ TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >+ new SearchEngine().searchAllTypeNames( >+ null, >+ new char[][] { "Test".toCharArray() }, >+ getJavaSearchScopeBugs(), >+ requestor, >+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >+ null); >+ // Should have same types with these 2 searches >+ assertTrue("We should get some types!", collector.size() > 0); >+ assertEquals("Found types sounds not to be correct", requestor.toString(), collector.toString()); >+} >+ >+/** >+ * @bug 160494: [search] searchAllTypeNames(char[][], char[][],...) fails to find types in default package >+ * @test Ensure that types of default packge are found when empty package is specified in package lists >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=160494" >+ */ >+public void testBug160324c() throws CoreException { >+ boolean debug = false; >+ char[][] packagesList = new char[][] { >+ CharOperation.NO_CHAR, >+ "b110422".toCharArray(), >+ "b123679.test".toCharArray(), >+ "b89848".toCharArray(), >+ "b95794".toCharArray(), >+ "pack".toCharArray(), >+ "pack.age".toCharArray() >+ }; >+ char[][] typesList = new char[][] { >+ "Test".toCharArray(), >+ "TestPrefix".toCharArray() >+ }; >+ // Search all type names with new API >+ TypeNameMatchCollector collector = new TypeNameMatchCollector() { >+ public String toString(){ >+ return toFullyQualifiedNamesString(); >+ } >+ }; >+ new SearchEngine().searchAllTypeNames( >+ packagesList, >+ typesList, >+ getJavaSearchScopeBugs(), >+ collector, >+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >+ null); >+ if (debug) System.out.println("TypeNameMatchRequestor results: \n"+collector); >+ // Search all type names with old API >+ TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >+ new SearchEngine().searchAllTypeNames( >+ packagesList, >+ typesList, >+ getJavaSearchScopeBugs(), >+ requestor, >+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >+ null); >+ if (debug) System.out.println("TypeNameRequestor results: \n"+requestor); >+ // Should have same types with these 2 searches >+ assertEquals("Wrong number of found types!", packagesList.length, collector.size()); >+ assertEquals("Found types sounds not to be correct", requestor.toString(), collector.toString()); >+} > } >\ No newline at end of file >Index: workspace/JavaSearchBugs/lib/b110422.jar >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/workspace/JavaSearchBugs/lib/b110422.jar,v >retrieving revision 1.1 >diff -u -r1.1 b110422.jar >Binary files /tmp/cvs.mIH2MY and b110422.jar differ
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 160323
: 51770