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 72463 Details for
Bug 194185
[search] for package declarations finds also subpackages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v01.txt (text/plain), 5.97 KB, created by
Frederic Fusier
on 2007-06-26 07:05:50 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2007-06-26 07:05:50 EDT
Size:
5.97 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: buildnotes_jdt-core.html >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/buildnotes_jdt-core.html,v >retrieving revision 1.5936 >diff -u -r1.5936 buildnotes_jdt-core.html >--- buildnotes_jdt-core.html 22 Jun 2007 15:50:32 -0000 1.5936 >+++ buildnotes_jdt-core.html 26 Jun 2007 11:04:19 -0000 >@@ -53,7 +53,9 @@ > <h2>What's new in this drop</h2> > > <h3>Problem Reports Fixed</h3> >-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=191908">191908</a> >+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=194185">194185</a> >+[search] for package declarations finds also subpackages >+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=191908">191908</a> > [1.5][compiler] Missing strike through for deprecated declaration fragment > <br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=192285">192285</a> > [formatter] Java source formatter not working if class has annotation on single line multiple fields declaration. >Index: search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java,v >retrieving revision 1.292 >diff -u -r1.292 MatchLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 11 May 2007 16:03:13 -0000 1.292 >+++ search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 26 Jun 2007 11:04:20 -0000 >@@ -1255,7 +1255,7 @@ > } > // Get all project package fragment names > this.nameLookup = ((JavaProject) projects[i]).newNameLookup(this.workingCopies); >- IPackageFragment[] packageFragments = this.nameLookup.findPackageFragments(new String(pkgPattern.pkgName), true, true); >+ IPackageFragment[] packageFragments = this.nameLookup.findPackageFragments(new String(pkgPattern.pkgName), false, true); > int pLength = packageFragments == null ? 0 : packageFragments.length; > // Report matches avoiding duplicate names > for (int p=0; p<pLength; p++) { >Index: model/org/eclipse/jdt/internal/core/util/Util.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java,v >retrieving revision 1.107 >diff -u -r1.107 Util.java >--- model/org/eclipse/jdt/internal/core/util/Util.java 24 Apr 2007 09:00:24 -0000 1.107 >+++ model/org/eclipse/jdt/internal/core/util/Util.java 26 Jun 2007 11:04:19 -0000 >@@ -1934,7 +1934,7 @@ > * Returns true if the n first elements of the prefix are equals and the last element of the > * prefix is a prefix of the corresponding element in the compound name. > */ >- public static boolean startsWithIgnoreCase(String[] compoundName, String[] prefix) { >+ public static boolean startsWithIgnoreCase(String[] compoundName, String[] prefix, boolean partialMatch) { > int prefixLength = prefix.length; > int nameLength = compoundName.length; > if (prefixLength > nameLength) return false; >@@ -1942,7 +1942,7 @@ > if (!compoundName[i].equalsIgnoreCase(prefix[i])) > return false; > } >- return compoundName[prefixLength-1].toLowerCase().startsWith(prefix[prefixLength-1].toLowerCase()); >+ return (partialMatch || prefixLength == nameLength) && compoundName[prefixLength-1].toLowerCase().startsWith(prefix[prefixLength-1].toLowerCase()); > } > > /* >Index: model/org/eclipse/jdt/internal/core/NameLookup.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NameLookup.java,v >retrieving revision 1.115 >diff -u -r1.115 NameLookup.java >--- model/org/eclipse/jdt/internal/core/NameLookup.java 27 Apr 2007 15:51:38 -0000 1.115 >+++ model/org/eclipse/jdt/internal/core/NameLookup.java 26 Jun 2007 11:04:19 -0000 >@@ -491,7 +491,7 @@ > if (pkgName != null) { > boolean match = hasPatternChars > ? Util.matchesWithIgnoreCase(pkgName, name) >- : Util.startsWithIgnoreCase(pkgName, splittedName); >+ : Util.startsWithIgnoreCase(pkgName, splittedName, partialMatch); > if (match) { > Object value = this.packageFragments.valueTable[i]; > if (value instanceof PackageFragmentRoot) { >@@ -857,7 +857,7 @@ > if (requestor.isCanceled()) > return; > String[] pkgName = (String[]) keys[i]; >- if (pkgName != null && Util.startsWithIgnoreCase(pkgName, splittedName)) { >+ if (pkgName != null && Util.startsWithIgnoreCase(pkgName, splittedName, partialMatch)) { > Object value = this.packageFragments.valueTable[i]; > if (value instanceof PackageFragmentRoot) { > PackageFragmentRoot root = (PackageFragmentRoot) value; >#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.107 >diff -u -r1.107 JavaSearchBugsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 11 May 2007 16:03:16 -0000 1.107 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 26 Jun 2007 11:04:23 -0000 >@@ -7996,4 +7996,22 @@ > packageCollector); > } > >+/** >+ * @bug 194185 [search] for package declarations finds also subpackages >+ * @test Ensure that exact package is found when no >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=194185" >+ */ >+public void testBug194185() throws CoreException { >+ JavaSearchResultCollector packageCollector = new JavaSearchResultCollector(true); >+ search( >+ "java", >+ PACKAGE, >+ DECLARATIONS, >+ SearchEngine.createWorkspaceScope(), >+ packageCollector); >+ assertSearchResults( >+ ""+ getExternalJCLPathString("1.5") + " java", >+ packageCollector); >+} >+ > } >\ 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 194185
: 72463