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 76897 Details for
Bug 201064
[search] SearchEngine.searchAllTypeNames(..) does not find CamelCase match
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed patch
v00.txt (text/plain), 8.70 KB, created by
Frederic Fusier
on 2007-08-24 09:50:28 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2007-08-24 09:50:28 EDT
Size:
8.70 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.119 >diff -u -r1.119 JavaSearchBugsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 24 Aug 2007 05:58:27 -0000 1.119 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 24 Aug 2007 13:51:54 -0000 >@@ -8502,6 +8502,7 @@ > "src/b137984 b137984\n" + > "src/b142044 b142044\n" + > "src/b163984 b163984\n" + >+ "src/b201064 b201064\n" + > "src/b81556 b81556\n" + > "src/b81556/a b81556.a\n" + > "src/b86380 b86380\n" + >@@ -8510,7 +8511,7 @@ > } > > /** >- * @bug 194185 [search] for package declarations finds also subpackages >+ * @bug 194185 [search] for package declarations finds also sub-packages > * @test Ensure that exact package is found when no > * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=194185" > */ >@@ -8838,4 +8839,82 @@ > ); > } > >+/** >+ * @bug 201064: [search] SearchEngine.searchAllTypeNames(..) does not find CamelCase match >+ * @test Ensure that indexing still works properly after close/restart >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=201064" >+ */ >+public void testBug201064() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CCase", SearchPattern.R_CAMEL_CASE_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CxxCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); >+} >+public void testBug201064b() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CaCase", SearchPattern.R_CAMEL_CASE_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); >+} >+public void testBug201064c() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CamelCase", SearchPattern.R_CAMEL_CASE_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); >+} >+public void testBug201064d() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CC", SearchPattern.R_CAMEL_CASE_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CxxCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CxxxxCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); >+} >+public void testBug201064e() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CaC", SearchPattern.R_CAMEL_CASE_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); >+} >+public void testBug201064f() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CamelC", SearchPattern.R_CAMEL_CASE_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); >+} >+public void testBug201064g() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CCa", SearchPattern.R_CAMEL_CASE_MATCH, collector); >+ assertSearchResults("", collector); >+} >+public void testBug201064h() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CaCa", SearchPattern.R_CAMEL_CASE_MATCH, collector); >+ assertSearchResults("", collector); >+} >+public void testBug201064i() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CamelCa", SearchPattern.R_CAMEL_CASE_MATCH, collector); >+ assertSearchResults("", collector); >+} >+ > } >\ No newline at end of file >Index: src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java,v >retrieving revision 1.27 >diff -u -r1.27 AbstractJavaSearchTests.java >--- src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java 24 Aug 2007 05:58:27 -0000 1.27 >+++ src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java 24 Aug 2007 13:51:52 -0000 >@@ -658,6 +658,19 @@ > null > ); > } >+ protected void searchAllTypeNames(String pattern, int matchRule, TypeNameMatchCollector collector) throws JavaModelException { >+ new SearchEngine(this.workingCopies).searchAllTypeNames( >+ null, >+ SearchPattern.R_EXACT_MATCH, >+ pattern.toCharArray(), >+ matchRule, >+ TYPE, >+ getJavaSearchScope(), >+ collector, >+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >+ null >+ ); >+ } > protected void searchDeclarationsOfAccessedFields(IJavaElement enclosingElement, SearchRequestor requestor) throws JavaModelException { > new SearchEngine().searchDeclarationsOfAccessedFields(enclosingElement, requestor, null); > } >Index: workspace/JavaSearchBugs/src/b201064/CamelCase.java >=================================================================== >RCS file: workspace/JavaSearchBugs/src/b201064/CamelCase.java >diff -N workspace/JavaSearchBugs/src/b201064/CamelCase.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ workspace/JavaSearchBugs/src/b201064/CamelCase.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,9 @@ >+package b201064; >+public class CamelCase {} >+class CatCase {} >+class CatCasexx {} >+class CxxCase {} >+class CxxxxCasexx {} >+class CamelCaseEntry {} >+class CamelCasexxEntry {} >+ >#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.6039 >diff -u -r1.6039 buildnotes_jdt-core.html >--- buildnotes_jdt-core.html 24 Aug 2007 13:02:30 -0000 1.6039 >+++ buildnotes_jdt-core.html 24 Aug 2007 13:51:56 -0000 >@@ -320,7 +320,9 @@ > </ul> > > <h3>Problem Reports Fixed</h3> >-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=183117">183117</a> >+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=201064">201064</a> >+[search] SearchEngine.searchAllTypeNames(..) does not find CamelCase match >+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=183117">183117</a> > User Library Lost > <br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=200400">200400</a> > [search] Camel Case match prefix insensitive although spec says prefix sensitive >Index: search/org/eclipse/jdt/internal/core/index/Index.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/Index.java,v >retrieving revision 1.28 >diff -u -r1.28 Index.java >--- search/org/eclipse/jdt/internal/core/index/Index.java 24 Aug 2007 05:59:05 -0000 1.28 >+++ search/org/eclipse/jdt/internal/core/index/Index.java 24 Aug 2007 13:51:56 -0000 >@@ -59,7 +59,9 @@ > // First test camel case if necessary > boolean isCamelCase = (matchRule & SearchPattern.R_CAMEL_CASE_MATCH) != 0; > if (isCamelCase) { >- if (pattern[0] == word[0] && CharOperation.camelCaseMatch(pattern, word, (matchRule & SearchPattern.R_PREFIX_MATCH) != 0)) { >+ // prefix is always needed as index key got characters after type simple name >+ // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=201064 >+ if (pattern[0] == word[0] && CharOperation.camelCaseMatch(pattern, word, true/*prefix match*/)) { > return true; > } > if ((matchRule & SearchPattern.R_CASE_SENSITIVE) != 0) return false;
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 201064
: 76897