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 76871 Details for
Bug 124624
[search] Camelcase matching routines should support end character
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch to be released
v04.txt (text/plain), 231.22 KB, created by
Frederic Fusier
on 2007-08-24 01:55:40 EDT
(
hide
)
Description:
Patch to be released
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2007-08-24 01:55:40 EDT
Size:
231.22 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java,v >retrieving revision 1.165 >diff -u -r1.165 JavaSearchTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java 19 Jul 2007 15:08:25 -0000 1.165 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java 24 Aug 2007 05:49:37 -0000 >@@ -3715,44 +3715,53 @@ > * > * These tests are not really duplicates of {@link JavaSearchBugsTests} ones > * as they also test camel case in indexes... >+ * @deprecated As using a depreciated constant > */ > public void testCamelCaseTypePattern01() throws CoreException { >- search("RE", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH, getJavaSearchScope()); >+ search("RE", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( > "src/a3/References.java a3.References [References]\n" + > ""+ getExternalJCLPathString() + " java.lang.RuntimeException" > ); > } >- >+public void testCamelCaseTypePattern01b() throws CoreException { >+ search("RE", TYPE, DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ ""+ getExternalJCLPathString() + " java.lang.RuntimeException" >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testCamelCaseTypePattern02() throws CoreException { >- search("RException", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH, getJavaSearchScope()); >+ search("RException", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( > ""+ getExternalJCLPathString() + " java.lang.RuntimeException" > ); > } >- >+/** @deprecated As using a depreciated constant */ > public void testCamelCaseTypePattern03() throws CoreException { >- search("RuntimeException", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH, getJavaSearchScope()); >+ search("RuntimeException", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( > ""+ getExternalJCLPathString() + " java.lang.RuntimeException" > ); > } >- >+/** @deprecated As using a depreciated constant */ > public void testCamelCaseTypePattern04() throws CoreException { >- search("RUNTIMEEXCEPTION", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH, getJavaSearchScope()); >+ search("RUNTIMEEXCEPTION", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( > ""+ getExternalJCLPathString() + " java.lang.RuntimeException" > ); > } >- >+/** >+ * @deprecated As using a depreciated constant >+ */ > public void testCamelCaseTypePattern05() throws CoreException { >- search("R*E*", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH, getJavaSearchScope()); >+ search("R*E*", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( > "src/a3/References.java a3.References [References]\n" + > ""+ getExternalJCLPathString() + " java.lang.RuntimeException" > ); > } >- >+/** @deprecated As using a depreciated constant */ > public void testCamelCaseTypePattern06() throws CoreException { > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); > new SearchEngine().searchAllTypeNames( >@@ -3771,7 +3780,7 @@ > "java.lang.CloneNotSupportedException", > requestor); > } >- >+/** @deprecated As using a depreciated constant */ > public void testCamelCaseTypePattern07() throws CoreException { > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); > new SearchEngine().searchAllTypeNames( >@@ -3794,7 +3803,7 @@ > "q1.AA", > requestor); > } >- >+/** @deprecated As using a depreciated constant */ > public void testCamelCaseTypePattern08() throws CoreException { > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); > new SearchEngine().searchAllTypeNames( >@@ -3816,7 +3825,7 @@ > "q1.AA", > requestor); > } >- >+/** @deprecated As using a depreciated constant */ > public void testCamelCaseTypePattern09() throws CoreException { > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); > new SearchEngine().searchAllTypeNames( >@@ -3838,6 +3847,152 @@ > "q1.AA", > requestor); > } >+/** @deprecated As using a depreciated constant */ >+public void testCamelCaseTypePattern10() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearch/src/Test.java", >+ "class Null {}\n" + >+ "class NULL {}\n" + >+ "class NullPointerException {}\n" + >+ "class NULLPointerException {}\n" + >+ "class NULLPOINTERException {}\n" + >+ "class NULLPOINTEREXCEPTION {}\n" >+ ); >+ search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); >+ assertSearchResults( >+ "src/Test.java Null [Null]\n" + >+ "src/Test.java NULL [NULL]\n" + >+ "src/Test.java NullPointerException [NullPointerException]\n" + >+ "src/Test.java NULLPointerException [NULLPointerException]\n" + >+ "src/Test.java NULLPOINTERException [NULLPOINTERException]\n" + >+ "src/Test.java NULLPOINTEREXCEPTION [NULLPOINTEREXCEPTION]" >+ ); >+} >+/** @deprecated As using a depreciated constant */ >+public void testCamelCaseTypePattern11() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearch/src/Test.java", >+ "class Null {}\n" + >+ "class NULL {}\n" + >+ "class NullPointerException {}\n" + >+ "class NULLPointerException {}\n" + >+ "class NULLPOINTERException {}\n" + >+ "class NULLPOINTEREXCEPTION {}\n" >+ ); >+ search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH); >+ assertSearchResults( >+ "src/Test.java Null [Null]\n" + >+ "src/Test.java NULL [NULL]\n" + >+ "src/Test.java NullPointerException [NullPointerException]\n" + >+ "src/Test.java NULLPointerException [NULLPointerException]\n" + >+ "src/Test.java NULLPOINTERException [NULLPOINTERException]\n" + >+ "src/Test.java NULLPOINTEREXCEPTION [NULLPOINTEREXCEPTION]" >+ ); >+} >+/** @deprecated As using a depreciated constant */ >+public void testCamelCaseTypePattern12() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearch/src/Test.java", >+ "class Null {}\n" + >+ "class NULL {}\n" + >+ "class NullPointerException {}\n" + >+ "class NULLPointerException {}\n" + >+ "class NULLPOINTERException {}\n" + >+ "class NULLPOINTEREXCEPTION {}\n" >+ ); >+ search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ assertSearchResults( >+ "src/Test.java Null [Null]" >+ ); >+} >+/** @deprecated As using a depreciated constant */ >+public void testCamelCaseTypePattern13() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearch/src/Test.java", >+ "class Null {}\n" + >+ "class NULL {}\n" + >+ "class NullPointerException {}\n" + >+ "class NULLPointerException {}\n" + >+ "class NULLPOINTERException {}\n" + >+ "class NULLPOINTEREXCEPTION {}\n" >+ ); >+ search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ assertSearchResults( >+ "src/Test.java Null [Null]\n" + >+ "src/Test.java NULL [NULL]\n" + >+ "src/Test.java NullPointerException [NullPointerException]\n" + >+ "src/Test.java NULLPointerException [NULLPointerException]\n" + >+ "src/Test.java NULLPOINTERException [NULLPOINTERException]\n" + >+ "src/Test.java NULLPOINTEREXCEPTION [NULLPOINTEREXCEPTION]" >+ ); >+} >+public void testCamelCaseTypePattern14() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearch/src/Test.java", >+ "class Null {}\n" + >+ "class NULL {}\n" + >+ "class NullPointerException {}\n" + >+ "class NULLPointerException {}\n" + >+ "class NULLPOINTERException {}\n" + >+ "class NULLPOINTEREXCEPTION {}\n" >+ ); >+ search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/Test.java Null [Null]\n" + >+ "src/Test.java NULL [NULL]" >+ ); >+} >+public void testCamelCaseTypePattern15() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearch/src/Test.java", >+ "class Null {}\n" + >+ "class NULL {}\n" + >+ "class NullPointerException {}\n" + >+ "class NULLPointerException {}\n" + >+ "class NULLPOINTERException {}\n" + >+ "class NULLPOINTEREXCEPTION {}\n" >+ ); >+ search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH); >+ assertSearchResults( >+ "src/Test.java Null [Null]\n" + >+ "src/Test.java NULL [NULL]\n" + >+ "src/Test.java NullPointerException [NullPointerException]\n" + >+ "src/Test.java NULLPointerException [NULLPointerException]\n" + >+ "src/Test.java NULLPOINTERException [NULLPOINTERException]\n" + >+ "src/Test.java NULLPOINTEREXCEPTION [NULLPOINTEREXCEPTION]" >+ ); >+} >+public void testCamelCaseTypePattern16() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearch/src/Test.java", >+ "class Null {}\n" + >+ "class NULL {}\n" + >+ "class NullPointerException {}\n" + >+ "class NULLPointerException {}\n" + >+ "class NULLPOINTERException {}\n" + >+ "class NULLPOINTEREXCEPTION {}\n" >+ ); >+ search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ assertSearchResults( >+ "src/Test.java Null [Null]" >+ ); >+} >+public void testCamelCaseTypePattern17() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearch/src/Test.java", >+ "class Null {}\n" + >+ "class NULL {}\n" + >+ "class NullPointerException {}\n" + >+ "class NULLPointerException {}\n" + >+ "class NULLPOINTERException {}\n" + >+ "class NULLPOINTEREXCEPTION {}\n" >+ ); >+ search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ assertSearchResults( >+ "src/Test.java Null [Null]\n" + >+ "src/Test.java NullPointerException [NullPointerException]" >+ ); >+} > > /** > * @bug 160323: [search] TypeNameMatch: support hashCode/equals >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.118 >diff -u -r1.118 JavaSearchBugsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 17 Aug 2007 06:14:44 -0000 1.118 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 24 Aug 2007 05:49:26 -0000 >@@ -103,18 +103,6 @@ > } > return getWorkingCopy(path, source, this.wcOwner); > } >-protected void search(IJavaElement element, int limitTo) throws CoreException { >- search(element, limitTo, EXACT_RULE, getJavaSearchScope(), resultCollector); >-} >-protected void search(IJavaElement element, int limitTo, int matchRule) throws CoreException { >- search(element, limitTo, matchRule, getJavaSearchScope(), resultCollector); >-} >-protected void search(String patternString, int searchFor, int limitTo) throws CoreException { >- search(patternString, searchFor, limitTo, EXACT_RULE, getJavaSearchScope(), resultCollector); >-} >-protected void search(String patternString, int searchFor, int limitTo, int matchRule) throws CoreException { >- search(patternString, searchFor, limitTo, matchRule, getJavaSearchScope(), resultCollector); >-} > /* (non-Javadoc) > * @see org.eclipse.jdt.core.tests.model.SuiteOfTestCases#setUpSuite() > */ >@@ -4731,7 +4719,7 @@ > "interface IDocumentExtension315 {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("IDE3", SearchPattern.R_CAMELCASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("IDE3", SearchPattern.R_CAMEL_CASE_MATCH); > searchAllTypeNames("IDE3", validatedRule, requestor); > assertSearchResults( > "IDocumentExtension135\n" + >@@ -4752,7 +4740,7 @@ > "interface IDocumentProviderExtension54321 {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("IDPE3", SearchPattern.R_CAMELCASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("IDPE3", SearchPattern.R_CAMEL_CASE_MATCH); > searchAllTypeNames("IDPE3", validatedRule, requestor); > assertSearchResults( > "IDocumentProviderExtension12345\n" + >@@ -4769,7 +4757,7 @@ > "interface IPerspectiveListener3 {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("IPL3", SearchPattern.R_CAMELCASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("IPL3", SearchPattern.R_CAMEL_CASE_MATCH); > searchAllTypeNames("IPL3", validatedRule, requestor); > assertSearchResults( > "IPerspectiveListener3", >@@ -4783,7 +4771,7 @@ > "interface IPropertySource2 {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("IPS2", SearchPattern.R_CAMELCASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("IPS2", SearchPattern.R_CAMEL_CASE_MATCH); > searchAllTypeNames("IPS2", validatedRule, requestor); > assertSearchResults( > "IPropertySource2", >@@ -4800,7 +4788,7 @@ > "interface IWorkbenchWindowPulldownDelegate4 {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("IWWPD2", SearchPattern.R_CAMELCASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("IWWPD2", SearchPattern.R_CAMEL_CASE_MATCH); > searchAllTypeNames("IWWPD2", validatedRule, requestor); > assertSearchResults( > "IWorkbenchWindowPulldownDelegate2", >@@ -4816,7 +4804,7 @@ > "class UTFDocScannerSupport {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("UTF16DSS", SearchPattern.R_CAMELCASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("UTF16DSS", SearchPattern.R_CAMEL_CASE_MATCH); > searchAllTypeNames("UTF16DSS", validatedRule, requestor); > assertSearchResults( > "UTF16DocumentScannerSupport", >@@ -4832,7 +4820,7 @@ > "class UTFDocScannerSupport {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("UTF1DSS", SearchPattern.R_CAMELCASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("UTF1DSS", SearchPattern.R_CAMEL_CASE_MATCH); > searchAllTypeNames("UTF1DSS", validatedRule, requestor); > assertSearchResults( > "UTF16DocumentScannerSupport\n" + >@@ -4849,7 +4837,7 @@ > "class UTFDocScannerSupport {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("UTF6DSS", SearchPattern.R_CAMELCASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("UTF6DSS", SearchPattern.R_CAMEL_CASE_MATCH); > searchAllTypeNames("UTF6DSS", validatedRule, requestor); > assertSearchResults( > "UTF16DocumentScannerSupport\n" + >@@ -4866,7 +4854,7 @@ > "class UTFDocScannerSupport {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("UTFDSS", SearchPattern.R_CAMELCASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("UTFDSS", SearchPattern.R_CAMEL_CASE_MATCH); > searchAllTypeNames("UTFDSS", validatedRule, requestor); > assertSearchResults( > "UTF16DocumentScannerSupport\n" + >@@ -4886,455 +4874,404 @@ > */ > // Types search > private void setUpBug110060_TypePattern() throws CoreException { >- workingCopies = new ICompilationUnit[5]; >- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110060/AA.java", >- "package b110060;\n" + >- "public class AA {\n" + >- "}\n" >- ); >- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b110060/AAxx.java", >- "package b110060;\n" + >- "public class AAxx {\n" + >- "}\n" >- ); >- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b110060/AxxAyy.java", >- "package b110060;\n" + >- "public class AxxAyy {\n" + >- "}\n" >- ); >- workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/b110060/AxA.java", >- "package b110060;\n" + >- "public class AxA {\n" + >- "}\n" >- ); >- workingCopies[4] = getWorkingCopy("/JavaSearchBugs/src/b110060/Test.java", >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110060/Test.java", > "package b110060;\n" + > "public class Test {\n" + >- " AA aa;\n" + >- " AAxx aaxx;\n" + >- " AxA axa;\n" + >- " AxxAyy axxayy;\n" + >- "}\n" >+ " Aaa a1;\n" + >+ " AAa a2;\n" + >+ " AaAaAa a3;\n" + >+ " AAxx a4;\n" + >+ " AxA a5;\n" + >+ " AxxAyy a6;\n" + >+ "}\n" + >+ "class AAa {}\n" + >+ "class Aaa {}\n" + >+ "class AaAaAa {}\n" + >+ "class AAxx {}\n" + >+ "class AxA {}\n" + >+ "class AxxAyy {}\n" > ); > } >+/** @deprecated As using a depreciated constant */ > public void testBug110060_TypePattern01() throws CoreException { > setUpBug110060_TypePattern(); > search("AA", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( >- "src/b110060/Test.java b110060.Test.aa [AA] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.aaxx [AAxx] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axa [AxA] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH" >+ "src/b110060/Test.java b110060.Test.a1 [Aaa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a2 [AAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a3 [AaAaAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a4 [AAxx] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a5 [AxA] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH" > ); > } >- >+public void testBug110060_TypePattern01new() throws CoreException { >+ setUpBug110060_TypePattern(); >+ search("AA", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/b110060/Test.java b110060.Test.a2 [AAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a4 [AAxx] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a5 [AxA] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_TypePattern02() throws CoreException { > setUpBug110060_TypePattern(); > search("AA", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( >- "src/b110060/AA.java b110060.AA [AA] EXACT_MATCH\n" + >- "src/b110060/AAxx.java b110060.AAxx [AAxx] EXACT_MATCH\n" + >- "src/b110060/AxA.java b110060.AxA [AxA] EXACT_MATCH\n" + >- "src/b110060/AxxAyy.java b110060.AxxAyy [AxxAyy] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.aa [AA] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.aaxx [AAxx] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axa [AxA] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH" >+ "src/b110060/Test.java b110060.Test.a1 [Aaa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a2 [AAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a3 [AaAaAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a4 [AAxx] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a5 [AxA] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.AAa [AAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Aaa [Aaa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.AaAaAa [AaAaAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.AAxx [AAxx] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.AxA [AxA] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.AxxAyy [AxxAyy] EXACT_MATCH" > ); > } >- >+public void testBug110060_TypePattern02new() throws CoreException { >+ setUpBug110060_TypePattern(); >+ search("AA", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/b110060/Test.java b110060.Test.a2 [AAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a4 [AAxx] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a5 [AxA] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.AAa [AAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.AAxx [AAxx] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.AxA [AxA] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.AxxAyy [AxxAyy] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_TypePattern03() throws CoreException { > setUpBug110060_TypePattern(); >- search("AAx", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >+ search("AAx", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( >- "src/b110060/AAxx.java b110060.AAxx [AAxx] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.aaxx [AAxx] EXACT_MATCH" >+ "src/b110060/Test.java b110060.Test.a4 [AAxx] EXACT_MATCH" > ); > } >- >+public void testBug110060_TypePattern03new() throws CoreException { >+ setUpBug110060_TypePattern(); >+ search("AAx", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "" // no result as camel case does not allow prefix match >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_TypePattern04() throws CoreException { > setUpBug110060_TypePattern(); >- search("Axx", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >+ search("Axx", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( >- "src/b110060/AxxAyy.java b110060.AxxAyy [AxxAyy] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH" >+ "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH" > ); > } >- >+public void testBug110060_TypePattern04new() throws CoreException { >+ setUpBug110060_TypePattern(); >+ search("Axx", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "" // no result as camel case does not allow prefix match >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_TypePattern05() throws CoreException { > setUpBug110060_TypePattern(); >- search("Ax", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >+ search("Ax", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( >- "src/b110060/AxA.java b110060.AxA [AxA] EXACT_MATCH\n" + >- "src/b110060/AxxAyy.java b110060.AxxAyy [AxxAyy] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axa [AxA] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH" >+ "src/b110060/Test.java b110060.Test.a5 [AxA] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH" > ); > } >- >+public void testBug110060_TypePattern05new() throws CoreException { >+ setUpBug110060_TypePattern(); >+ search("Ax", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "" // no result as camel case does not allow prefix match >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_TypePattern06() throws CoreException { > setUpBug110060_TypePattern(); >- search("A*A*", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >+ search("A*A*", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( >- "src/b110060/AA.java b110060.AA [AA] EXACT_MATCH\n" + >- "src/b110060/AAxx.java b110060.AAxx [AAxx] EXACT_MATCH\n" + >- "src/b110060/AxA.java b110060.AxA [AxA] EXACT_MATCH\n" + >- "src/b110060/AxxAyy.java b110060.AxxAyy [AxxAyy] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.aa [AA] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.aaxx [AAxx] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axa [AxA] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH\n" + >- ""+ getExternalJCLPathString("1.5") + " java.lang.annotation.Annotation EXACT_MATCH" >+ "src/b110060/Test.java b110060.Test.a1 [Aaa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a2 [AAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a3 [AaAaAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a4 [AAxx] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a5 [AxA] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH" > ); > } >- >+public void testBug110060_TypePattern06new() throws CoreException { >+ setUpBug110060_TypePattern(); >+ search("A*A*", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/b110060/Test.java b110060.Test.a1 [Aaa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a2 [AAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a3 [AaAaAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a4 [AAxx] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a5 [AxA] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_TypePattern07() throws CoreException { > setUpBug110060_TypePattern(); >- search("aa", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >- assertSearchResults(""); >+ search("aa", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); >+ assertSearchResults( >+ "" // no result because it's an invalid camel case pattern which is replaced with >+ // prefix case sensitive match bu SearchPatter.validateMatchRule(...) (old behavior) >+ ); >+} >+public void testBug110060_TypePattern07new() throws CoreException { >+ setUpBug110060_TypePattern(); >+ search("aa", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ // Not a valid camel case pattern => changed to prefix >+ assertSearchResults( >+ "src/b110060/Test.java b110060.Test.a1 [Aaa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a2 [AAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a3 [AaAaAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a4 [AAxx] EXACT_MATCH" >+ ); > } >- > public void testBug110060_TypePattern08() throws CoreException { > setUpBug110060_TypePattern(); >- search("aa", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH); >+ search("aa", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH); > assertSearchResults( >- "src/b110060/AA.java b110060.AA [AA] EXACT_MATCH\n" + >- "src/b110060/AAxx.java b110060.AAxx [AAxx] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.aa [AA] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.aaxx [AAxx] EXACT_MATCH" >+ "src/b110060/Test.java b110060.Test.a1 [Aaa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a2 [AAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a3 [AaAaAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a4 [AAxx] EXACT_MATCH" > ); > } >- > public void testBug110060_TypePattern09() throws CoreException { > setUpBug110060_TypePattern(); >- search("AA", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ search("AA", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE); > assertSearchResults( >- "src/b110060/AA.java b110060.AA [AA] EXACT_MATCH\n" + >- "src/b110060/AAxx.java b110060.AAxx [AAxx] EXACT_MATCH\n" + >- "src/b110060/AxA.java b110060.AxA [AxA] EXACT_MATCH\n" + >- "src/b110060/AxxAyy.java b110060.AxxAyy [AxxAyy] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.aa [AA] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.aaxx [AAxx] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axa [AxA] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH" >+ "src/b110060/Test.java b110060.Test.a2 [AAa] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a4 [AAxx] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a5 [AxA] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH" > ); > } >- >+/** @deprecated As using a depreciated constant */ > public void testBug110060_TypePattern10() throws CoreException { > setUpBug110060_TypePattern(); >- search("AxAx", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >+ search("AxAx", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults(""); > } >- >+public void testBug110060_TypePattern10new() throws CoreException { >+ setUpBug110060_TypePattern(); >+ search("AxAx", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults(""); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_TypePattern11() throws CoreException { > setUpBug110060_TypePattern(); >- search("AxxA", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >+ search("AxxA", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( >- "src/b110060/AxxAyy.java b110060.AxxAyy [AxxAyy] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH" >+ "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH" > ); > } >- >+public void testBug110060_TypePattern11new() throws CoreException { >+ setUpBug110060_TypePattern(); >+ search("AxxA", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_TypePattern12() throws CoreException { > setUpBug110060_TypePattern(); >- search("AxXA", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >+ search("AxXA", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( >- "src/b110060/AxxAyy.java b110060.AxxAyy [AxxAyy] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH" >+ "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH" > ); > } >+public void testBug110060_TypePattern12new() throws CoreException { >+ setUpBug110060_TypePattern(); >+ search("AxXA", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults(""); >+} > >+// Search all type names requests >+/** @deprecated As using a depreciated constant */ > public void testBug110060_AllTypeNames01() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine(this.workingCopies).searchAllTypeNames( >- null, >- SearchPattern.R_EXACT_MATCH, >- "AA".toCharArray(), >- SearchPattern.R_CAMELCASE_MATCH, >- TYPE, >- getJavaSearchScope(), >- requestor, >- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >- null >- ); >+ searchAllTypeNames("AA", SearchPattern.R_CAMELCASE_MATCH, requestor); > assertSearchResults( > "Unexpected all type names", >- "b110060.AA\n" + >- "b110060.AAxx\n" + >- "b110060.AxA\n" + >+ "b110060.AAa\n" + >+ "b110060.AAxx\n" + >+ "b110060.AaAaAa\n" + >+ "b110060.Aaa\n" + >+ "b110060.AxA\n" + >+ "b110060.AxxAyy", >+ requestor); >+} >+public void testBug110060_AllTypeNames01new() throws CoreException { >+ setUpBug110060_TypePattern(); >+ TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >+ searchAllTypeNames("AA", SearchPattern.R_CAMEL_CASE_MATCH, requestor); >+ assertSearchResults( >+ "Unexpected all type names", >+ "b110060.AAa\n" + >+ "b110060.AAxx\n" + >+ "b110060.AxA\n" + > "b110060.AxxAyy", > requestor); > } >- > public void testBug110060_AllTypeNames02() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine(this.workingCopies).searchAllTypeNames( >- null, >- SearchPattern.R_EXACT_MATCH, >- "AA".toCharArray(), >- SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH, >- TYPE, >- getJavaSearchScope(), >- requestor, >- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >- null >- ); >+ searchAllTypeNames("AA", SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH, requestor); > assertSearchResults( > "Unexpected all type names", >- "b110060.AA\n" + >- "b110060.AAxx\n" + >- "b110060.AxA\n" + >+ "b110060.AAa\n" + >+ "b110060.AAxx\n" + >+ "b110060.AaAaAa\n" + >+ "b110060.Aaa\n" + >+ "b110060.AxA\n" + > "b110060.AxxAyy", > requestor); > } >- > public void testBug110060_AllTypeNames03() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine(this.workingCopies).searchAllTypeNames( >- null, >- SearchPattern.R_EXACT_MATCH, >- "AA".toCharArray(), >- SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE, >- TYPE, >- getJavaSearchScope(), >- requestor, >- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >- null >- ); >+ searchAllTypeNames("AAA", SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); > assertSearchResults( > "Unexpected all type names", >- "b110060.AA\n" + >- "b110060.AAxx\n" + >- "b110060.AxA\n" + >- "b110060.AxxAyy", >+ "b110060.AaAaAa", > requestor); > } >- > public void testBug110060_AllTypeNames04() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine(this.workingCopies).searchAllTypeNames( >- null, >- SearchPattern.R_EXACT_MATCH, >- "AA".toCharArray(), >- SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, >- TYPE, >- getJavaSearchScope(), >- requestor, >- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >- null >- ); >+ searchAllTypeNames("AA", SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); > assertSearchResults( > "Unexpected all type names", >- "b110060.AA\n" + >- "b110060.AAxx\n" + >- "b110060.AxA\n" + >+ "b110060.AAa\n" + >+ "b110060.AAxx\n" + >+ "b110060.AaAaAa\n" + >+ "b110060.AxA\n" + > "b110060.AxxAyy", > requestor); > } >- > public void testBug110060_AllTypeNames05() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine(this.workingCopies).searchAllTypeNames( >- null, >- SearchPattern.R_EXACT_MATCH, >- "AA".toCharArray(), >- SearchPattern.R_PREFIX_MATCH, >- TYPE, >- getJavaSearchScope(), >- requestor, >- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >- null >- ); >+ searchAllTypeNames("AA", SearchPattern.R_PREFIX_MATCH, requestor); > assertSearchResults( > "Unexpected all type names", >- "b110060.AA\n" + >- "b110060.AAxx", >+ "b110060.AAa\n" + >+ "b110060.AAxx\n" + >+ "b110060.AaAaAa\n" + >+ "b110060.Aaa", > requestor); > } >- > public void testBug110060_AllTypeNames06() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine(this.workingCopies).searchAllTypeNames( >- null, >- SearchPattern.R_EXACT_MATCH, >- "AA".toCharArray(), >- SearchPattern.R_CASE_SENSITIVE, >- TYPE, >- getJavaSearchScope(), >- requestor, >- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >- null >- ); >+ searchAllTypeNames("AAA", SearchPattern.R_CASE_SENSITIVE, requestor); > assertSearchResults( > "Unexpected all type names", >- "b110060.AA", >+ "", > requestor); > } >- > public void testBug110060_AllTypeNames07() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine(this.workingCopies).searchAllTypeNames( >- null, >- SearchPattern.R_EXACT_MATCH, >- "AA".toCharArray(), >- SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, >- TYPE, >- getJavaSearchScope(), >- requestor, >- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >- null >- ); >+ searchAllTypeNames("AA", SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); > assertSearchResults( > "Unexpected all type names", >- "b110060.AA\n" + >+ "b110060.AAa\n" + > "b110060.AAxx", > requestor); > } >- >+/** @deprecated As using a depreciated constant */ > public void testBug110060_AllTypeNames08() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine(this.workingCopies).searchAllTypeNames( >- null, >- SearchPattern.R_EXACT_MATCH, >- "aa".toCharArray(), >- SearchPattern.R_CAMELCASE_MATCH, >- TYPE, >- getJavaSearchScope(), >- requestor, >- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >- null >- ); >+ searchAllTypeNames("aa", SearchPattern.R_CAMELCASE_MATCH, requestor); > assertSearchResults( > "Unexpected all type names", >- "b110060.AA\n" + >- "b110060.AAxx", >+ "b110060.AAa\n" + >+ "b110060.AAxx\n" + >+ "b110060.AaAaAa\n" + >+ "b110060.Aaa", >+ requestor); >+} >+public void testBug110060_AllTypeNames08new() throws CoreException { >+ setUpBug110060_TypePattern(); >+ TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >+ searchAllTypeNames("aa", SearchPattern.R_CAMEL_CASE_MATCH, requestor); >+ assertSearchResults( >+ "Unexpected all type names", >+ "", // no match as pattern is not a valid camel case > requestor); > } >- > public void testBug110060_AllTypeNames09() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine(this.workingCopies).searchAllTypeNames( >- null, >- SearchPattern.R_EXACT_MATCH, >- "aa".toCharArray(), >- SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH, >- TYPE, >- getJavaSearchScope(), >- requestor, >- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >- null >- ); >+ searchAllTypeNames("aa", SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH, requestor); > assertSearchResults( > "Unexpected all type names", >- "b110060.AA\n" + >- "b110060.AAxx", >+ "b110060.AAa\n" + >+ "b110060.AAxx\n" + >+ "b110060.AaAaAa\n" + >+ "b110060.Aaa", > requestor); > } >- > public void testBug110060_AllTypeNames10() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine(this.workingCopies).searchAllTypeNames( >- null, >- SearchPattern.R_EXACT_MATCH, >- "aa".toCharArray(), >- SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE, >- TYPE, >- getJavaSearchScope(), >- requestor, >- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >- null >- ); >+ searchAllTypeNames("aa", SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); > assertSearchResults( > "Unexpected all type names", >- "", >+ "", // no match as pattern is not a valid camel case > requestor); > } >- > public void testBug110060_AllTypeNames11() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine(this.workingCopies).searchAllTypeNames( >- null, >- SearchPattern.R_EXACT_MATCH, >- "aa".toCharArray(), >- SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, >- TYPE, >- getJavaSearchScope(), >- requestor, >- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >- null >- ); >+ searchAllTypeNames("aa", SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); > assertSearchResults( > "Unexpected all type names", > "", > requestor); > } >- > public void testBug110060_AllTypeNames12() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine(this.workingCopies).searchAllTypeNames( >- null, >- SearchPattern.R_EXACT_MATCH, >- "aa".toCharArray(), >- SearchPattern.R_PREFIX_MATCH, >- TYPE, >- getJavaSearchScope(), >- requestor, >- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >- null >- ); >+ searchAllTypeNames("aa", SearchPattern.R_PREFIX_MATCH, requestor); > assertSearchResults( > "Unexpected all type names", >- "b110060.AA\n" + >- "b110060.AAxx", >+ "b110060.AAa\n" + >+ "b110060.AAxx\n" + >+ "b110060.AaAaAa\n" + >+ "b110060.Aaa", > requestor); > } >- > public void testBug110060_AllTypeNames13() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine(this.workingCopies).searchAllTypeNames( >- null, >- SearchPattern.R_EXACT_MATCH, >- "aa".toCharArray(), >- SearchPattern.R_CASE_SENSITIVE, >- TYPE, >- getJavaSearchScope(), >- requestor, >- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >- null >- ); >+ searchAllTypeNames("aa", SearchPattern.R_CASE_SENSITIVE, requestor); > assertSearchResults( > "Unexpected all type names", > "", > requestor); > } >- > public void testBug110060_AllTypeNames14() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine(this.workingCopies).searchAllTypeNames( >- null, >- SearchPattern.R_EXACT_MATCH, >- "aa".toCharArray(), >- SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, >- TYPE, >- getJavaSearchScope(), >- requestor, >- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >- null >- ); >+ searchAllTypeNames("aa", SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); > assertSearchResults( > "Unexpected all type names", > "", >@@ -5380,7 +5317,7 @@ > } > public void testBug110060_ConstructorPattern01() throws CoreException { > setUpBug110060_ConstructorPattern(); >- search("AA", CONSTRUCTOR, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); >+ search("AA", CONSTRUCTOR, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); > assertSearchResults( > "src/b110060/Test.java b110060.Test.aa [new AA()] EXACT_MATCH\n" + > "src/b110060/Test.java b110060.Test.aaxx [new AAxx()] EXACT_MATCH\n" + >@@ -5388,10 +5325,9 @@ > "src/b110060/Test.java b110060.Test.axxayy [new AxxAyy()] EXACT_MATCH" > ); > } >- > public void testBug110060_ConstructorPattern02() throws CoreException { > setUpBug110060_ConstructorPattern(); >- search("AA", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >+ search("AA", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); > assertSearchResults( > "src/b110060/AA.java b110060.AA() [AA] EXACT_MATCH\n" + > "src/b110060/AAxx.java b110060.AAxx() [AAxx] EXACT_MATCH\n" + >@@ -5403,39 +5339,30 @@ > "src/b110060/Test.java b110060.Test.axxayy [new AxxAyy()] EXACT_MATCH" > ); > } >- > public void testBug110060_ConstructorPattern03() throws CoreException { > setUpBug110060_ConstructorPattern(); >- search("AAx", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >+ search("AAx", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); > assertSearchResults( >- "src/b110060/AAxx.java b110060.AAxx() [AAxx] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.aaxx [new AAxx()] EXACT_MATCH" >+ "" // no match as prefix is not set > ); > } >- > public void testBug110060_ConstructorPattern04() throws CoreException { > setUpBug110060_ConstructorPattern(); >- search("Axx", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >+ search("Axx", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); > assertSearchResults( >- "src/b110060/AxxAyy.java b110060.AxxAyy() [AxxAyy] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axxayy [new AxxAyy()] EXACT_MATCH" >+ "" // no match as prefix is not set > ); > } >- > public void testBug110060_ConstructorPattern05() throws CoreException { > setUpBug110060_ConstructorPattern(); >- search("Ax", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >+ search("Ax", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); > assertSearchResults( >- "src/b110060/AxA.java b110060.AxA() [AxA] EXACT_MATCH\n" + >- "src/b110060/AxxAyy.java b110060.AxxAyy() [AxxAyy] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axa [new AxA()] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axxayy [new AxxAyy()] EXACT_MATCH" >+ "" // no match as prefix is not set > ); > } >- > public void testBug110060_ConstructorPattern06() throws CoreException { > setUpBug110060_ConstructorPattern(); >- search("A*A*", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >+ search("A*A*", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); > assertSearchResults( > "src/b110060/AA.java b110060.AA() [AA] EXACT_MATCH\n" + > "src/b110060/AAxx.java b110060.AAxx() [AAxx] EXACT_MATCH\n" + >@@ -5469,18 +5396,29 @@ > "}\n" > ); > } >+/** @deprecated As using a depreciated constant */ > public void testBug110060_MethodPattern01() throws CoreException { > setUpBug110060_MethodPattern(); > search("MWD", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults(""); > } >- >-public void testBug110060_MethodPattern02() throws CoreException { >+public void testBug110060_MethodPattern01new() throws CoreException { >+ setUpBug110060_MethodPattern(); >+ search("MWD", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults(""); >+} >+/** @deprecated As using a depreciated constant */ >+public void testBug110060_MethodPattern02() throws CoreException { > setUpBug110060_MethodPattern(); > search("AMWD", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults(""); > } >- >+public void testBug110060_MethodPattern02new() throws CoreException { >+ setUpBug110060_MethodPattern(); >+ search("AMWD", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults(""); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_MethodPattern03() throws CoreException { > setUpBug110060_MethodPattern(); > search("aMWD", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -5491,7 +5429,15 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1DigitAnd_AnUnderscore()] EXACT_MATCH" > ); > } >- >+public void testBug110060_MethodPattern03new() throws CoreException { >+ setUpBug110060_MethodPattern(); >+ search("aMWD", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/b110060/Test.java void b110060.Test.aMethodWith1Digit() [aMethodWith1Digit] EXACT_MATCH\n" + >+ "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Digit()] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_MethodPattern04() throws CoreException { > setUpBug110060_MethodPattern(); > search("aMW", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -5506,7 +5452,14 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWithNothingSpecial()] EXACT_MATCH" > ); > } >- >+public void testBug110060_MethodPattern04new() throws CoreException { >+ setUpBug110060_MethodPattern(); >+ search("aMW", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "" // no result as prefix match is not set >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_MethodPattern05() throws CoreException { > setUpBug110060_MethodPattern(); > search("aMethod", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -5521,7 +5474,14 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWithNothingSpecial()] EXACT_MATCH" > ); > } >- >+public void testBug110060_MethodPattern05new() throws CoreException { >+ setUpBug110060_MethodPattern(); >+ search("aMethod", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "" // no result as prefix match is not set >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_MethodPattern06() throws CoreException { > setUpBug110060_MethodPattern(); > search("aMethodWith1", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -5534,7 +5494,14 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores()] EXACT_MATCH" > ); > } >- >+public void testBug110060_MethodPattern06new() throws CoreException { >+ setUpBug110060_MethodPattern(); >+ search("aMethodWith1", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "" // no result as prefix match is not set >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_MethodPattern07() throws CoreException { > setUpBug110060_MethodPattern(); > search("*Method*With*A*", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -5549,7 +5516,21 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [otherMethodWhichStartsWithAnotherLetter()] EXACT_MATCH" > ); > } >- >+public void testBug110060_MethodPattern07new() throws CoreException { >+ setUpBug110060_MethodPattern(); >+ search("*Method*With*A*", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/b110060/Test.java void b110060.Test.aMethodWithNothingSpecial() [aMethodWithNothingSpecial] EXACT_MATCH\n" + >+ "src/b110060/Test.java void b110060.Test.aMethodWith1DigitAnd_AnUnderscore() [aMethodWith1DigitAnd_AnUnderscore] EXACT_MATCH\n" + >+ "src/b110060/Test.java void b110060.Test.aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores] EXACT_MATCH\n" + >+ "src/b110060/Test.java void b110060.Test.otherMethodWhichStartsWithAnotherLetter() [otherMethodWhichStartsWithAnotherLetter] EXACT_MATCH\n" + >+ "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1DigitAnd_AnUnderscore()] EXACT_MATCH\n" + >+ "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores()] EXACT_MATCH\n" + >+ "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWithNothingSpecial()] EXACT_MATCH\n" + >+ "src/b110060/Test.java void b110060.Test.testReferences() [otherMethodWhichStartsWithAnotherLetter()] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_MethodPattern08() throws CoreException { > setUpBug110060_MethodPattern(); > search("aMW1D", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -5560,7 +5541,15 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1DigitAnd_AnUnderscore()] EXACT_MATCH" > ); > } >- >+public void testBug110060_MethodPattern08new() throws CoreException { >+ setUpBug110060_MethodPattern(); >+ search("aMW1D", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/b110060/Test.java void b110060.Test.aMethodWith1Digit() [aMethodWith1Digit] EXACT_MATCH\n" + >+ "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Digit()] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_MethodPattern09() throws CoreException { > setUpBug110060_MethodPattern(); > search("aMWOOODASU", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -5569,6 +5558,14 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores()] EXACT_MATCH" > ); > } >+public void testBug110060_MethodPattern09new() throws CoreException { >+ setUpBug110060_MethodPattern(); >+ search("aMWOOODASU", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/b110060/Test.java void b110060.Test.aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores] EXACT_MATCH\n" + >+ "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores()] EXACT_MATCH" >+ ); >+} > > // Fields search > private void setUpBug110060_FieldPattern() throws CoreException { >@@ -5591,6 +5588,7 @@ > "}\n" > ); > } >+/** @deprecated As using a depreciated constant */ > public void testBug110060_FieldPattern01() throws CoreException { > setUpBug110060_FieldPattern(); > search("aFWSD", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -5601,13 +5599,26 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aFieldWith$Several$DollarslAnd1DigitAnd_1Underscore] EXACT_MATCH" > ); > } >- >+public void testBug110060_FieldPattern01new() throws CoreException { >+ setUpBug110060_FieldPattern(); >+ search("aFWSD", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/b110060/Test.java b110060.Test.aFieldWithS$Dollar [aFieldWithS$Dollar] EXACT_MATCH\n" + >+ "src/b110060/Test.java void b110060.Test.testReferences() [aFieldWithS$Dollar] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_FieldPattern02() throws CoreException { > setUpBug110060_FieldPattern(); > search("afwsd", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults(""); > } >- >+public void testBug110060_FieldPattern02new() throws CoreException { >+ setUpBug110060_FieldPattern(); >+ search("afwsd", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults(""); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_FieldPattern03() throws CoreException { > setUpBug110060_FieldPattern(); > search("aFWS$", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -5616,7 +5627,14 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aFieldWithS$Dollar] EXACT_MATCH" > ); > } >- >+public void testBug110060_FieldPattern03new() throws CoreException { >+ setUpBug110060_FieldPattern(); >+ search("aFWS$", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "" // no result as prefix match is not set >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_FieldPattern04() throws CoreException { > setUpBug110060_FieldPattern(); > search("aSFWSCD", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -5625,7 +5643,15 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aStrangeFieldWith$$$$$$$$$$$$$$$SeveraContiguousDollars] EXACT_MATCH" > ); > } >- >+public void testBug110060_FieldPattern04new() throws CoreException { >+ setUpBug110060_FieldPattern(); >+ search("aSFWSCD", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/b110060/Test.java b110060.Test.aStrangeFieldWith$$$$$$$$$$$$$$$SeveraContiguousDollars [aStrangeFieldWith$$$$$$$$$$$$$$$SeveraContiguousDollars] EXACT_MATCH\n" + >+ "src/b110060/Test.java void b110060.Test.testReferences() [aStrangeFieldWith$$$$$$$$$$$$$$$SeveraContiguousDollars] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug110060_FieldPattern05() throws CoreException { > setUpBug110060_FieldPattern(); > search("oF", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -5635,6 +5661,13 @@ > "src/b110060/Test.java b110060.Test.oF [otherFieldWhichStartsWithAnotherLetter] EXACT_MATCH" > ); > } >+public void testBug110060_FieldPattern05new() throws CoreException { >+ setUpBug110060_FieldPattern(); >+ search("oF", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/b110060/Test.java b110060.Test.oF [oF] EXACT_MATCH" >+ ); >+} > > /** > * @test Bug 110291: [search] BasicSearchEngine return constructor declarations that doesn't exist in source >@@ -6418,6 +6451,269 @@ > } > > /** >+ * @bug 124624: [search] Camel case matching routines should support end character >+ * @test Ensure that camel case pattern may use end character >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=124624" >+ */ >+public void testBug124624_HM_new() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HM", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >+ "src/Test.java HtmlMapper [HtmlMapper] EXACT_MATCH\n" + >+ "src/Test.java HatMappage [HatMappage] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ >+public void testBug124624_HM_old() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HM", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >+ "src/Test.java HtmlMapper [HtmlMapper] EXACT_MATCH\n" + >+ "src/Test.java HashMapEntry [HashMapEntry] EXACT_MATCH\n" + >+ "src/Test.java HatMappage [HatMappage] EXACT_MATCH" >+ ); >+} >+public void testBug124624_HaM_new() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HaM", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >+ "src/Test.java HatMappage [HatMappage] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ >+public void testBug124624_HaM_old() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HaM", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >+ "src/Test.java HashMapEntry [HashMapEntry] EXACT_MATCH\n" + >+ "src/Test.java HatMappage [HatMappage] EXACT_MATCH" >+ ); >+} >+public void testBug124624_HashM_new() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HashM", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ >+public void testBug124624_HashM_old() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HashM", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >+ "src/Test.java HashMapEntry [HashMapEntry] EXACT_MATCH" >+ ); >+} >+public void testBug124624_HMa_new() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HMa", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults(""); >+} >+/** @deprecated As using a depreciated constant */ >+public void testBug124624_HMa_old() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HMa", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >+ "src/Test.java HtmlMapper [HtmlMapper] EXACT_MATCH\n" + >+ "src/Test.java HashMapEntry [HashMapEntry] EXACT_MATCH\n" + >+ "src/Test.java HatMappage [HatMappage] EXACT_MATCH" >+ ); >+} >+public void testBug124624_HaMa_new() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HaMa", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults(""); >+} >+/** @deprecated As using a depreciated constant */ >+public void testBug124624_HaMa_old() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HashMa", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >+ "src/Test.java HashMapEntry [HashMapEntry] EXACT_MATCH" >+ ); >+} >+public void testBug124624_HashMa_new() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HashMa", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults(""); >+} >+/** @deprecated As using a depreciated constant */ >+public void testBug124624_HashMa_old() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HashM", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >+ "src/Test.java HashMapEntry [HashMapEntry] EXACT_MATCH" >+ ); >+} >+public void testBug124624_HMap_new() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HMap", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ >+public void testBug124624_HMap_old() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HMap", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >+ "src/Test.java HtmlMapper [HtmlMapper] EXACT_MATCH\n" + >+ "src/Test.java HashMapEntry [HashMapEntry] EXACT_MATCH\n" + >+ "src/Test.java HatMappage [HatMappage] EXACT_MATCH" >+ ); >+} >+public void testBug124624_HaMap_new() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HaMap", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ >+public void testBug124624_HaMap_old() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HaMap", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >+ "src/Test.java HashMapEntry [HashMapEntry] EXACT_MATCH\n" + >+ "src/Test.java HatMappage [HatMappage] EXACT_MATCH" >+ ); >+} >+public void testBug124624_HashMap_new() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HashMap", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ >+public void testBug124624_HashMap_old() throws CoreException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "class HashMap {}\n" + >+ "class HtmlMapper {}\n" + >+ "class HashMapEntry {}\n" + >+ "class HatMappage {}\n" >+ ); >+ search("HashMap", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >+ "src/Test.java HashMapEntry [HashMapEntry] EXACT_MATCH" >+ ); >+} >+ >+/** > * @test Bug 124645: [search] for implementors does not find subclasses of binary classes > * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=124645" > */ >@@ -6610,6 +6906,7 @@ > "}\n" > ); > } >+/** @deprecated As using a depreciated constant */ > public void testBug130390() throws CoreException { > setUpBug130390(); > search("NuPoEx", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); >@@ -6617,6 +6914,14 @@ > "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH" > ); > } >+public void testBug130390_new() throws CoreException { >+ setUpBug130390(); >+ search("NuPoEx", TYPE, DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "" // no result as prefix match is not set >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug130390b() throws CoreException { > setUpBug130390(); > search("NPE", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); >@@ -6625,6 +6930,15 @@ > "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH" > ); > } >+public void testBug130390b_new() throws CoreException { >+ setUpBug130390(); >+ search("NPE", TYPE, DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/b130390/Npe.java b130390.Npe [Npe] EXACT_MATCH\n" + >+ "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug130390c() throws CoreException { > setUpBug130390(); > search("NPE", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >@@ -6632,6 +6946,14 @@ > "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH" > ); > } >+public void testBug130390c_new() throws CoreException { >+ setUpBug130390(); >+ search("NPE", TYPE, DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ assertSearchResults( >+ "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug130390d() throws CoreException { > setUpBug130390(); > search("Npe", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -6639,6 +6961,14 @@ > "src/b130390/Npe.java b130390.Npe [Npe] EXACT_MATCH" > ); > } >+public void testBug130390d_new() throws CoreException { >+ setUpBug130390(); >+ search("Npe", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/b130390/Npe.java b130390.Npe [Npe] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug130390e() throws CoreException { > setUpBug130390(); > search("Npe", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >@@ -6646,6 +6976,14 @@ > "src/b130390/Npe.java b130390.Npe [Npe] EXACT_MATCH" > ); > } >+public void testBug130390e_new() throws CoreException { >+ setUpBug130390(); >+ search("Npe", TYPE, DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ assertSearchResults( >+ "src/b130390/Npe.java b130390.Npe [Npe] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug130390f() throws CoreException { > setUpBug130390(); > search("NullPE", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -6653,6 +6991,14 @@ > "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH" > ); > } >+public void testBug130390f_new() throws CoreException { >+ setUpBug130390(); >+ search("NullPE", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ assertSearchResults( >+ "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH" >+ ); >+} >+/** @deprecated As using a depreciated constant */ > public void testBug130390g() throws CoreException { > setUpBug130390(); > search("TZ", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >@@ -6661,263 +7007,149 @@ > "src/b130390/TimeZone.java b130390.TimeZone [TimeZone] EXACT_MATCH" > ); > } >-public void testBug130390h() throws CoreException { >+public void testBug130390g_new() throws CoreException { > setUpBug130390(); >- search("TiZo", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ search("TZ", TYPE, DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE); > assertSearchResults( >+ "src/b130390/TZ.java b130390.TZ [TZ] EXACT_MATCH\n" + > "src/b130390/TimeZone.java b130390.TimeZone [TimeZone] EXACT_MATCH" > ); > } >+public void testBug130390h() throws CoreException { >+ setUpBug130390(); >+ search("TiZo", TYPE, DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ assertSearchResults( >+ "" // no result as prefix match is not set >+ ); >+} >+ > /** > * To get these tests search matches in a workspace, do NOT forget to modify files > * to set them as working copies. > * >- * @test Bug 137087: Open Type - missing matches when using mixed case pattern >+ * @bug 137087: Open Type - missing matches when using mixed case pattern > * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=137087" >+ * @deprecated As using a depreciated constant > */ > public void testBug137087() throws CoreException { >- // Search CamelCase > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "runtimeEx"; > search(pattern, TYPE, DECLARATIONS, matchRule); > assertSearchResults( > ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH" > ); >- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) >- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); >- if (validatedRule != matchRule) { >- matchRule = SearchPattern.R_PREFIX_MATCH; >- } >- search(pattern, TYPE, DECLARATIONS, matchRule); >- assertSearchResults( >- ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH\n" + >- ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH" >- ); > } >+/** @deprecated As using a depreciated constant */ > public void testBug137087b() throws CoreException { >- // Search CamelCase > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "Runtimeex"; > search(pattern, TYPE, DECLARATIONS, matchRule); > assertSearchResults( > ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH" > ); >- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) >- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); >- if (validatedRule != matchRule) { >- matchRule = SearchPattern.R_PREFIX_MATCH; >- } >- search(pattern, TYPE, DECLARATIONS, matchRule); >- assertSearchResults( >- ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH\n" + >- ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH" >- ); > } >+/** @deprecated As using a depreciated constant */ > public void testBug137087c() throws CoreException { >- // Search CamelCase > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "runtimeexception"; > search(pattern, TYPE, DECLARATIONS, matchRule); > assertSearchResults( >- "" // no match expected as this is not a valid camel case >- ); >- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) >- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); >- if (validatedRule != matchRule) { >- matchRule = SearchPattern.R_PREFIX_MATCH; >- } >- search(pattern, TYPE, DECLARATIONS, matchRule); >- assertSearchResults( >- ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH" >+ "" // no result because it's an invalid camel case pattern which is replaced with >+ // prefix case sensitive match bu SearchPatter.validateMatchRule(...) (old behavior) > ); > } >+/** @deprecated As using a depreciated constant */ > public void testBug137087d() throws CoreException { >- // Search CamelCase > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "Runtimexception"; > search(pattern, TYPE, DECLARATIONS, matchRule); > assertSearchResults( > "" // no match expected as pattern is missing a 'e' > ); >- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) >- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); >- if (validatedRule != matchRule) { >- matchRule = SearchPattern.R_PREFIX_MATCH; >- } >- search(pattern, TYPE, DECLARATIONS, matchRule); >- assertSearchResults( >- "" // no match expected as pattern is missing a 'e' >- ); > } >+/** @deprecated As using a depreciated constant */ > public void testBug137087e() throws CoreException { >- // Search CamelCase > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "IllegalMSException"; > search(pattern, TYPE, DECLARATIONS, matchRule); > assertSearchResults( > ""+ getExternalJCLPathString("1.5") + " java.lang.IllegalMonitorStateException EXACT_MATCH" > ); >- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) >- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); >- if (validatedRule != matchRule) { >- matchRule = SearchPattern.R_PREFIX_MATCH; >- } >- search(pattern, TYPE, DECLARATIONS, matchRule); >- assertSearchResults( >- ""+ getExternalJCLPathString("1.5") + " java.lang.IllegalMonitorStateException EXACT_MATCH\n" + >- ""+ getExternalJCLPathString("1.5") + " java.lang.IllegalMonitorStateException EXACT_MATCH" >- ); > } >+/** @deprecated As using a depreciated constant */ > public void testBug137087f() throws CoreException { >- // Search CamelCase > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "illegalMsExceptionSException"; > search(pattern, TYPE, DECLARATIONS, matchRule); > assertSearchResults( > "" // expected no result as uppercase characters in pattern do not match any camelcase ones in existing types > ); >- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) >- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); >- if (validatedRule != matchRule) { >- matchRule = SearchPattern.R_PREFIX_MATCH; >- } >- search(pattern, TYPE, DECLARATIONS, matchRule); >- assertSearchResults( >- "" // expected no result as uppercase characters in pattern do not match any camelcase ones in existing types >- ); > } >+/** @deprecated As using a depreciated constant */ > public void testBug137087g() throws CoreException { >- // Search CamelCase > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "clonenotsupportedex"; > search(pattern, TYPE, DECLARATIONS, matchRule); > assertSearchResults( >- "" // no match expected as this is not a valid camel case >- ); >- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) >- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); >- if (validatedRule != matchRule) { >- matchRule = SearchPattern.R_PREFIX_MATCH; >- } >- search(pattern, TYPE, DECLARATIONS, matchRule); >- assertSearchResults( >- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" >+ "" // no result because it's an invalid camel case pattern which is replaced with >+ // prefix case sensitive match bu SearchPatter.validateMatchRule(...) (old behavior) > ); > } >+/** @deprecated As using a depreciated constant */ > public void testBug137087h() throws CoreException { >- // Search CamelCase > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "CloneNotSupportedEx"; > search(pattern, TYPE, DECLARATIONS, matchRule); > assertSearchResults( > ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" > ); >- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) >- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); >- if (validatedRule != matchRule) { >- matchRule = SearchPattern.R_PREFIX_MATCH; >- } >- search(pattern, TYPE, DECLARATIONS, matchRule); >- assertSearchResults( >- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" + >- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" >- ); > } >+/** @deprecated As using a depreciated constant */ > public void testBug137087i() throws CoreException { >- // Search CamelCase > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "cloneNotsupportedEx"; > search(pattern, TYPE, DECLARATIONS, matchRule); > assertSearchResults( > ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" > ); >- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) >- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); >- if (validatedRule != matchRule) { >- matchRule = SearchPattern.R_PREFIX_MATCH; >- } >- search(pattern, TYPE, DECLARATIONS, matchRule); >- assertSearchResults( >- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" + >- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" >- ); > } >+/** @deprecated As using a depreciated constant */ > public void testBug137087j() throws CoreException { >- // Search CamelCase > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "ClonenotSupportedexc"; > search(pattern, TYPE, DECLARATIONS, matchRule); > assertSearchResults( > ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" > ); >- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) >- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); >- if (validatedRule != matchRule) { >- matchRule = SearchPattern.R_PREFIX_MATCH; >- } >- search(pattern, TYPE, DECLARATIONS, matchRule); >- assertSearchResults( >- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" + >- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" >- ); > } >+/** @deprecated As using a depreciated constant */ > public void testBug137087k() throws CoreException { >- // Search CamelCase > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "cloneNotSupportedExcep"; > search(pattern, TYPE, DECLARATIONS, matchRule); > assertSearchResults( > ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" > ); >- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) >- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); >- if (validatedRule != matchRule) { >- matchRule = SearchPattern.R_PREFIX_MATCH; >- } >- search(pattern, TYPE, DECLARATIONS, matchRule); >- assertSearchResults( >- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" + >- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" >- ); > } >+/** @deprecated As using a depreciated constant */ > public void testBug137087l() throws CoreException { >- // Search CamelCase > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "Clonenotsupportedexception"; > search(pattern, TYPE, DECLARATIONS, matchRule); > assertSearchResults( > ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" > ); >- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) >- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); >- if (validatedRule != matchRule) { >- matchRule = SearchPattern.R_PREFIX_MATCH; >- } >- search(pattern, TYPE, DECLARATIONS, matchRule); >- assertSearchResults( >- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" + >- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" >- ); > } >+/** @deprecated As using a depreciated constant */ > public void testBug137087m() throws CoreException { >- // Search CamelCase > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "CloneNotSupportedException"; > search(pattern, TYPE, DECLARATIONS, matchRule); > assertSearchResults( > ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" > ); >- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) >- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); >- if (validatedRule != matchRule) { >- matchRule = SearchPattern.R_PREFIX_MATCH; >- } >- search(pattern, TYPE, DECLARATIONS, matchRule); >- assertSearchResults( >- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" + >- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" >- ); > } >+ > /** > * Bug 137984: [search] Field references not found when type is a qualified member type [regression] > * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=137984" >Index: src/org/eclipse/jdt/core/tests/model/SearchTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SearchTests.java,v >retrieving revision 1.41 >diff -u -r1.41 SearchTests.java >--- src/org/eclipse/jdt/core/tests/model/SearchTests.java 15 Aug 2007 11:14:56 -0000 1.41 >+++ src/org/eclipse/jdt/core/tests/model/SearchTests.java 24 Aug 2007 05:49:38 -0000 >@@ -124,7 +124,7 @@ > } > } > static { >-// TESTS_NAMES = new String[] { "testSearchPatternCreation25" }; >+ TESTS_PREFIX = "testSearchPatternValidateMatchRule"; > } > public static Test suite() { > return buildModelTestSuite(SearchTests.class); >@@ -185,13 +185,18 @@ > } > protected void assertValidMatchRule(String pattern, int rule, int expected) { > int validated = SearchPattern.validateMatchRule(pattern, rule); >+ String givenRule = BasicSearchEngine.getMatchRuleString(rule); > String validatedRule = BasicSearchEngine.getMatchRuleString(validated); > String expectedRule = BasicSearchEngine.getMatchRuleString(expected); > if (!validatedRule.equals(expectedRule)) { > System.out.println("Test "+getName()); > System.out.print(" assertValidMatchRule(\""); > System.out.print(pattern); >- System.out.print("\", "); >+ System.out.println("\","); >+ System.out.print(" SearchPattern."); >+ System.out.print(givenRule); >+ System.out.println("\","); >+ System.out.print(" SearchPattern."); > System.out.print(validatedRule); > System.out.println(");"); > assertEquals(pattern+"' does not match expected match rule!", expectedRule, validatedRule); >@@ -993,43 +998,165 @@ > "TypeReferencePattern: qualification<X.*>, type<Y>, exact match, case sensitive, erasure only", > searchPattern); > } >+ > /** >- * Test CamelCase validation >+ * Test pattern validation > */ > public void testSearchPatternValidMatchRule01() { >- assertValidMatchRule("foo", SearchPattern.R_EXACT_MATCH, SearchPattern.R_EXACT_MATCH); >- assertValidMatchRule("foo", SearchPattern.R_PREFIX_MATCH, SearchPattern.R_PREFIX_MATCH); >- assertValidMatchRule("foo", SearchPattern.R_PATTERN_MATCH, SearchPattern.R_EXACT_MATCH); >- assertValidMatchRule("foo", SearchPattern.R_PATTERN_MATCH|SearchPattern.R_PREFIX_MATCH, SearchPattern.R_PREFIX_MATCH); >- assertValidMatchRule("foo", SearchPattern.R_CAMELCASE_MATCH, SearchPattern.R_PREFIX_MATCH|SearchPattern.R_CASE_SENSITIVE); >+ assertValidMatchRule("foo", >+ SearchPattern.R_EXACT_MATCH, >+ SearchPattern.R_EXACT_MATCH); > } > public void testSearchPatternValidMatchRule02() { >- assertValidMatchRule("CP*P", SearchPattern.R_EXACT_MATCH, SearchPattern.R_PATTERN_MATCH); >- assertValidMatchRule("CP*P", SearchPattern.R_PREFIX_MATCH, SearchPattern.R_PATTERN_MATCH); >- assertValidMatchRule("CP*P", SearchPattern.R_PATTERN_MATCH, SearchPattern.R_PATTERN_MATCH); >- assertValidMatchRule("CP*P", SearchPattern.R_PATTERN_MATCH|SearchPattern.R_PREFIX_MATCH, SearchPattern.R_PATTERN_MATCH); >- assertValidMatchRule("CP*P", SearchPattern.R_CAMELCASE_MATCH, SearchPattern.R_PATTERN_MATCH); >+ assertValidMatchRule("foo", >+ SearchPattern.R_PREFIX_MATCH, >+ SearchPattern.R_PREFIX_MATCH); > } > public void testSearchPatternValidMatchRule03() { >- assertValidMatchRule("NPE", SearchPattern.R_CAMELCASE_MATCH); >+ assertValidMatchRule("foo", >+ SearchPattern.R_PATTERN_MATCH, >+ SearchPattern.R_EXACT_MATCH); >+} >+public void testSearchPatternValidMatchRule04() { >+ assertValidMatchRule("foo", >+ SearchPattern.R_PATTERN_MATCH | SearchPattern.R_PREFIX_MATCH, >+ SearchPattern.R_PREFIX_MATCH); >+} >+/** @deprecated As using a depreciated constant */ >+public void testSearchPatternValidMatchRule05() { >+ assertValidMatchRule("foo", >+ SearchPattern.R_CAMELCASE_MATCH, >+ SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE); >+} >+public void testSearchPatternValidMatchRule06() { >+ assertValidMatchRule("foo", >+ SearchPattern.R_CAMEL_CASE_MATCH, >+ SearchPattern.R_PREFIX_MATCH); >+} >+public void testSearchPatternValidMatchRule10() { >+ assertValidMatchRule("CP*P", >+ SearchPattern.R_EXACT_MATCH, >+ SearchPattern.R_PATTERN_MATCH); >+} >+public void testSearchPatternValidMatchRule11() { >+ assertValidMatchRule("CP*P", >+ SearchPattern.R_PREFIX_MATCH, >+ SearchPattern.R_PATTERN_MATCH); >+} >+public void testSearchPatternValidMatchRule12() { >+ assertValidMatchRule("CP*P", >+ SearchPattern.R_PATTERN_MATCH, >+ SearchPattern.R_PATTERN_MATCH); >+} >+public void testSearchPatternValidMatchRule13() { >+ assertValidMatchRule("CP*P", >+ SearchPattern.R_PATTERN_MATCH | SearchPattern.R_PREFIX_MATCH, >+ SearchPattern.R_PATTERN_MATCH); >+} >+/** @deprecated As using a depreciated constant */ >+public void testSearchPatternValidMatchRule14() { >+ assertValidMatchRule("CP*P", >+ SearchPattern.R_CAMELCASE_MATCH, >+ SearchPattern.R_PATTERN_MATCH); >+} >+public void testSearchPatternValidMatchRule15() { >+ assertValidMatchRule("CP*P", >+ SearchPattern.R_CAMEL_CASE_MATCH, >+ SearchPattern.R_PATTERN_MATCH); >+} >+/** @deprecated As using a depreciated constant */ >+public void testSearchPatternValidMatchRule20() { >+ assertValidMatchRule("NPE", >+ SearchPattern.R_CAMELCASE_MATCH); >+} >+/** @deprecated As using a depreciated constant */ >+public void testSearchPatternValidMatchRule21() { > assertValidMatchRule("NPE", >- SearchPattern.R_CAMELCASE_MATCH|SearchPattern.R_PREFIX_MATCH|SearchPattern.R_CASE_SENSITIVE, >+ SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, > SearchPattern.R_CAMELCASE_MATCH); >- assertValidMatchRule("nPE", SearchPattern.R_CAMELCASE_MATCH); >- assertValidMatchRule("NuPoEx", SearchPattern.R_CAMELCASE_MATCH); >- assertValidMatchRule("oF", SearchPattern.R_CAMELCASE_MATCH); > } >-public void testSearchPatternValidMatchRule04() { >+/** @deprecated As using a depreciated constant */ >+public void testSearchPatternValidMatchRule22() { >+ assertValidMatchRule("nPE", >+ SearchPattern.R_CAMELCASE_MATCH); >+} >+/** @deprecated As using a depreciated constant */ >+public void testSearchPatternValidMatchRule23() { >+ assertValidMatchRule("NuPoEx", >+ SearchPattern.R_CAMELCASE_MATCH); >+} >+/** @deprecated As using a depreciated constant */ >+public void testSearchPatternValidMatchRule24() { >+ assertValidMatchRule("oF", >+ SearchPattern.R_CAMELCASE_MATCH); >+} >+public void testSearchPatternValidMatchRule30() { >+ assertValidMatchRule("NPE", >+ SearchPattern.R_CAMEL_CASE_MATCH); >+} >+public void testSearchPatternValidMatchRule31() { >+ assertValidMatchRule("NPE", >+ SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH); >+} >+public void testSearchPatternValidMatchRule32() { >+ assertValidMatchRule("NPE", >+ SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >+} >+public void testSearchPatternValidMatchRule33() { >+ assertValidMatchRule("NPE", >+ SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE); >+} >+public void testSearchPatternValidMatchRule34() { >+ assertValidMatchRule("nPE", >+ SearchPattern.R_CAMEL_CASE_MATCH); >+} >+public void testSearchPatternValidMatchRule35() { >+ assertValidMatchRule("NuPoEx", >+ SearchPattern.R_CAMEL_CASE_MATCH); >+} >+public void testSearchPatternValidMatchRule36() { >+ assertValidMatchRule("oF", >+ SearchPattern.R_CAMEL_CASE_MATCH); >+} >+/** @deprecated As using a depreciated constant */ >+public void testSearchPatternValidMatchRule40() { > assertValidMatchRule("Nu/Po/Ex", > SearchPattern.R_CAMELCASE_MATCH, >- SearchPattern.R_PREFIX_MATCH|SearchPattern.R_CASE_SENSITIVE); >+ SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE); >+} >+/** @deprecated As using a depreciated constant */ >+public void testSearchPatternValidMatchRule41() { > assertValidMatchRule("Nu.Po.Ex", >- SearchPattern.R_CAMELCASE_MATCH|SearchPattern.R_PREFIX_MATCH, >+ SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH, > SearchPattern.R_PREFIX_MATCH); > } >-public void testSearchPatternValidMatchRule05() { >- assertValidMatchRule("hashMap", SearchPattern.R_CAMELCASE_MATCH); >- assertValidMatchRule("Hashmap", SearchPattern.R_CAMELCASE_MATCH); >+/** @deprecated As using a depreciated constant */ >+public void testSearchPatternValidMatchRule42() { >+ assertValidMatchRule("hashMap", >+ SearchPattern.R_CAMELCASE_MATCH); >+} >+/** @deprecated As using a depreciated constant */ >+public void testSearchPatternValidMatchRule43() { >+ assertValidMatchRule("Hashmap", >+ SearchPattern.R_CAMELCASE_MATCH); >+} >+public void testSearchPatternValidMatchRule44() { >+ assertValidMatchRule("Nu/Po/Ex", >+ SearchPattern.R_CAMEL_CASE_MATCH, >+ SearchPattern.R_PREFIX_MATCH); >+} >+public void testSearchPatternValidMatchRule45() { >+ assertValidMatchRule("Nu.Po.Ex", >+ SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH, >+ SearchPattern.R_PREFIX_MATCH); >+} >+public void testSearchPatternValidMatchRule46() { >+ assertValidMatchRule("hashMap", >+ SearchPattern.R_CAMEL_CASE_MATCH); >+} >+public void testSearchPatternValidMatchRule47() { >+ assertValidMatchRule("Hashmap", >+ SearchPattern.R_CAMEL_CASE_MATCH); > } > > /** >Index: src/org/eclipse/jdt/core/tests/model/JavaSearchMultipleProjectsTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchMultipleProjectsTests.java,v >retrieving revision 1.43 >diff -u -r1.43 JavaSearchMultipleProjectsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchMultipleProjectsTests.java 10 Aug 2007 08:14:19 -0000 1.43 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchMultipleProjectsTests.java 24 Aug 2007 05:49:28 -0000 >@@ -923,6 +923,7 @@ > * @bug 199392: [search] Type Dialog Error 'Items filtering ... Reason: Class file name must end with .class' > * @test Ensure that types are found even in project which name ends either with ".jar" or ".zip" > * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=199392" >+ * @deprecated As using a depreciated constant > */ > public void testBug199392_Jar() throws CoreException { > try { >@@ -952,8 +953,6 @@ > collector, > IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, > null); >- // Should have same types with these 2 searches >- assertEquals("Invalid number of types found!", 1, collector.size()); > assertEquals("Found types sounds not to be correct", > "test.MyClass", > collector.toString() >@@ -962,6 +961,43 @@ > deleteProject("Test.jar"); > } > } >+public void testBug199392_Jar_new() throws CoreException { >+ try { >+ IJavaProject project = createJavaProject("Test.jar"); >+ createFolder("/Test.jar/test"); >+ createFile( >+ "/Test.jar/test/MyClass.java", >+ "package test;\n" + >+ "public class MyClass {\n" + >+ "}\n" >+ ); >+ >+ // Search all type names with TypeNameMatchRequestor >+ AbstractJavaSearchTests.TypeNameMatchCollector collector = new AbstractJavaSearchTests.TypeNameMatchCollector() { >+ public String toString(){ >+ return toFullyQualifiedNamesString(); >+ } >+ }; >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }); >+ new SearchEngine().searchAllTypeNames( >+ null, >+ SearchPattern.R_EXACT_MATCH, >+ new char[] { 'M', 'y' }, >+ SearchPattern.R_CAMEL_CASE_MATCH, >+ IJavaSearchConstants.TYPE, >+ scope, >+ collector, >+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >+ null); >+ assertEquals("Found types sounds not to be correct", >+ "", // no result as prefix match is not set >+ collector.toString() >+ ); >+ } finally { >+ deleteProject("Test.jar"); >+ } >+} >+/** @deprecated As using a depreciated constant */ > public void testBug199392_Zip() throws CoreException { > try { > IJavaProject project = createJavaProject("Test.zip"); >@@ -990,8 +1026,6 @@ > collector, > IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, > null); >- // Should have same types with these 2 searches >- assertEquals("Invalid number of types found!", 1, collector.size()); > assertEquals("Found types sounds not to be correct", > "test.MyClass", > collector.toString() >@@ -1000,4 +1034,40 @@ > deleteProject("Test.zip"); > } > } >+public void testBug199392_Zip_new() throws CoreException { >+ try { >+ IJavaProject project = createJavaProject("Test.zip"); >+ createFolder("/Test.zip/test"); >+ createFile( >+ "/Test.zip/test/MyClass.java", >+ "package test;\n" + >+ "public class MyClass {\n" + >+ "}\n" >+ ); >+ >+ // Search all type names with TypeNameMatchRequestor >+ AbstractJavaSearchTests.TypeNameMatchCollector collector = new AbstractJavaSearchTests.TypeNameMatchCollector() { >+ public String toString(){ >+ return toFullyQualifiedNamesString(); >+ } >+ }; >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }); >+ new SearchEngine().searchAllTypeNames( >+ null, >+ SearchPattern.R_EXACT_MATCH, >+ new char[] { 'M', 'y' }, >+ SearchPattern.R_CAMEL_CASE_MATCH, >+ IJavaSearchConstants.TYPE, >+ scope, >+ collector, >+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >+ null); >+ assertEquals("Found types sounds not to be correct", >+ "", // no result as prefix match is not set >+ collector.toString() >+ ); >+ } finally { >+ deleteProject("Test.zip"); >+ } >+} > } >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.26 >diff -u -r1.26 AbstractJavaSearchTests.java >--- src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java 16 Aug 2007 13:13:21 -0000 1.26 >+++ src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java 24 Aug 2007 05:49:08 -0000 >@@ -503,6 +503,7 @@ > } > } > System.out.println("--------------------------------------------------------------------------------"); >+ length *= 2; > for (int i=0; i<length; i+=2) { > System.out.println(sources[i]); > System.out.println(sources[i+1]); >@@ -632,6 +633,18 @@ > requestor, > null); > } >+ protected void search(IJavaElement element, int limitTo) throws CoreException { >+ search(element, limitTo, EXACT_RULE, getJavaSearchScope(), resultCollector); >+ } >+ protected void search(IJavaElement element, int limitTo, int matchRule) throws CoreException { >+ search(element, limitTo, matchRule, getJavaSearchScope(), resultCollector); >+ } >+ protected void search(String patternString, int searchFor, int limitTo) throws CoreException { >+ search(patternString, searchFor, limitTo, EXACT_RULE, getJavaSearchScope(), resultCollector); >+ } >+ protected void search(String patternString, int searchFor, int limitTo, int matchRule) throws CoreException { >+ search(patternString, searchFor, limitTo, matchRule, getJavaSearchScope(), resultCollector); >+ } > protected void searchAllTypeNames(String pattern, int matchRule, TypeNameRequestor requestor) throws JavaModelException { > new SearchEngine(this.workingCopies).searchAllTypeNames( > null, >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java,v >retrieving revision 1.33 >diff -u -r1.33 UtilTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java 18 Apr 2006 16:27:43 -0000 1.33 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java 24 Aug 2007 05:49:50 -0000 >@@ -13,6 +13,7 @@ > import java.io.File; > > //import org.apache.tools.ant.types.selectors.SelectorUtils; >+import org.eclipse.core.runtime.CoreException; > import org.eclipse.jdt.core.compiler.CharOperation; > > //import junit.framework.AssertionFailedError; >@@ -36,7 +37,14 @@ > * If result is invalid then store warning in buffer and display it. > */ > void assertCamelCase(String pattern, String name, boolean match) { >- boolean camelCase = CharOperation.camelCaseMatch(pattern==null?null:pattern.toCharArray(), name==null?null:name.toCharArray()); >+ assertCamelCase(pattern, name, true /*prefix match*/, match); >+} >+/** >+ * Assert that a pattern and a name matches or not. >+ * If result is invalid then store warning in buffer and display it. >+ */ >+void assertCamelCase(String pattern, String name, boolean prefixMatch, boolean match) { >+ boolean camelCase = CharOperation.camelCaseMatch(pattern==null?null:pattern.toCharArray(), name==null?null:name.toCharArray(), prefixMatch); > if (match != camelCase) { > StringBuffer line = new StringBuffer("'"); > line.append(name); >@@ -608,6 +616,128 @@ > // Verify that there were no unexpected results > assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0); > } >+ >+// bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=109695 >+public void test70() throws CoreException { >+ assertCamelCase("IDE3", "IDocumentExtension", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("IDE3", "IDocumentExtension2", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("IDE3", "IDocumentExtension3", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("IDE3", "IDocumentExtension135", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("IDE3", "IDocumentExtension315", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("IDPE3", "IDocumentProviderExtension", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("IDPE3", "IDocumentProviderExtension2", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("IDPE3", "IDocumentProviderExtension4", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("IDPE3", "IDocumentProviderExtension3", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("IDPE3", "IDocumentProviderExtension5", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("IDPE3", "IDocumentProviderExtension54321", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("IDPE3", "IDocumentProviderExtension12345", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("IPL3", "IPerspectiveListener", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("IPL3", "IPerspectiveListener2", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("IPL3", "IPerspectiveListener3", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("IPS2", "IPropertySource", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("IPS2", "IPropertySource2", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("IWWPD2", "IWorkbenchWindowPulldownDelegate", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("IWWPD2", "IWorkbenchWindowPulldownDelegate2", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("UTF16DSS", "UTF16DocumentScannerSupport", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("UTF16DSS", "UTF1DocScannerSupport", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("UTF16DSS", "UTF6DocScannerSupport", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("UTF16DSS", "UTFDocScannerSupport", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("UTF1DSS", "UTF16DocumentScannerSupport", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("UTF1DSS", "UTF1DocScannerSupport", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("UTF1DSS", "UTF6DocScannerSupport", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("UTF1DSS", "UTFDocScannerSupport", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("UTF6DSS", "UTF16DocumentScannerSupport", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("UTF6DSS", "UTF1DocScannerSupport", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("UTF6DSS", "UTF6DocScannerSupport", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("UTF6DSS", "UTFDocScannerSupport", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("UTFDSS", "UTF16DocumentScannerSupport", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("UTFDSS", "UTF1DocScannerSupport", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("UTFDSS", "UTF6DocScannerSupport", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("UTFDSS", "UTFDocScannerSupport", false /*no prefix match*/, true /* should match */); >+ // Verify that there were no unexpected results >+ assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0); >+} >+// bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=124624 >+public void test71() { >+ assertCamelCase("HM", "HashMap", false /*no prefix match*/, true /*should match*/); >+ assertCamelCase("HM", "HtmlMapper", false /*no prefix match*/, true /*should match*/); >+ assertCamelCase("HM", "HashMapEntry", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HaM", "HashMap", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("HaM", "HtmlMapper", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HaM", "HashMapEntry", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HashM", "HashMap", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("HashM", "HtmlMapper", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HashM", "HashMapEntry", false /*no prefix match*/, false /* should not match */); >+ // Verify that there were no unexpected results >+ assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0); >+} >+public void test71b() { // previous test cases but with 3.3 behavior >+ assertCamelCase("HM", "HashMap", true /*should match*/); >+ assertCamelCase("HM", "HtmlMapper", true /*should match*/); >+ assertCamelCase("HM", "HashMapEntry", true /*should match*/); >+ assertCamelCase("HaM", "HashMap", true /* should match */); >+ assertCamelCase("HaM", "HtmlMapper", false /*should not match*/); >+ assertCamelCase("HaM", "HashMapEntry", true /*should match*/); >+ assertCamelCase("HashM", "HashMap", true /* should match */); >+ assertCamelCase("HashM", "HtmlMapper", false /*should not match*/); >+ assertCamelCase("HashM", "HashMapEntry", true /*should match*/); >+ // Verify that there were no unexpected results >+ assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0); >+} >+// bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=124624 >+public void test72() { >+ assertCamelCase("HMa", "HashMap", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HMa", "HtmlMapper", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HMa", "HashMapEntry", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HaMa", "HashMap", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HaMa", "HtmlMapper", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HaMa", "HashMapEntry", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HashMa", "HashMap", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HashMa", "HtmlMapper", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HashMa", "HashMapEntry", false /*no prefix match*/, false /* should not match */); >+ // Verify that there were no unexpected results >+ assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0); >+} >+public void test72b() { // previous test cases but with 3.3 behavior >+ assertCamelCase("HMa", "HashMap", true /*should match*/); >+ assertCamelCase("HMa", "HtmlMapper", true /*should match*/); >+ assertCamelCase("HMa", "HashMapEntry", true /*should match*/); >+ assertCamelCase("HaMa", "HashMap", true /* should match */); >+ assertCamelCase("HaMa", "HtmlMapper", false /*should not match*/); >+ assertCamelCase("HaMa", "HashMapEntry", true /*should match*/); >+ assertCamelCase("HashMa", "HashMap", true /* should match */); >+ assertCamelCase("HashMa", "HtmlMapper", false /*should not match*/); >+ assertCamelCase("HashMa", "HashMapEntry", true /*should match*/); >+ // Verify that there were no unexpected results >+ assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0); >+} >+// bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=124624 >+public void test73() { >+ assertCamelCase("HMap", "HashMap", false /*no prefix match*/, true /*should match*/); >+ assertCamelCase("HMap", "HtmlMapper", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HMap", "HashMapEntry", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HaMap", "HashMap", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("HaMap", "HtmlMapper", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HaMap", "HashMapEntry", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HashMap", "HashMap", false /*no prefix match*/, true /* should match */); >+ assertCamelCase("HashMap", "HtmlMapper", false /*no prefix match*/, false /* should not match */); >+ assertCamelCase("HashMap", "HashMapEntry", false /*no prefix match*/, false /* should not match */); >+ // Verify that there were no unexpected results >+ assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0); >+} >+public void test73b() { // previous test cases but with 3.3 behavior >+ assertCamelCase("HMap", "HashMap", true /*should match*/); >+ assertCamelCase("HMap", "HtmlMapper", true /*should match*/); >+ assertCamelCase("HMap", "HashMapEntry", true /*should match*/); >+ assertCamelCase("HaMap", "HashMap", true /* should match */); >+ assertCamelCase("HaMap", "HtmlMapper", false /*should not match*/); >+ assertCamelCase("HaMap", "HashMapEntry", true /*should match*/); >+ assertCamelCase("HashMap", "HashMap", true /* should match */); >+ assertCamelCase("HashMap", "HtmlMapper", false /*should not match*/); >+ assertCamelCase("HashMap", "HashMapEntry", true /*should match*/); >+ // Verify that there were no unexpected results >+ assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0); >+} > public static Class testClass() { > return UtilTest.class; > } >#P org.eclipse.jdt.core >Index: search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java,v >retrieving revision 1.77 >diff -u -r1.77 TypeReferencePattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java 4 Jul 2007 13:59:58 -0000 1.77 >+++ search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java 24 Aug 2007 05:50:23 -0000 >@@ -32,8 +32,8 @@ > public TypeReferencePattern(char[] qualification, char[] simpleName, int matchRule) { > this(matchRule); > >- this.qualification = isCaseSensitive() ? qualification : CharOperation.toLowerCase(qualification); >- this.simpleName = (isCaseSensitive() || isCamelCase()) ? simpleName : CharOperation.toLowerCase(simpleName); >+ this.qualification = this.isCaseSensitive ? qualification : CharOperation.toLowerCase(qualification); >+ this.simpleName = (this.isCaseSensitive || this.isCamelCase) ? simpleName : CharOperation.toLowerCase(simpleName); > > if (simpleName == null) > this.segments = this.qualification == null ? ONE_STAR_CHAR : CharOperation.splitOn('.', this.qualification); >Index: search/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.java,v >retrieving revision 1.35 >diff -u -r1.35 QualifiedTypeDeclarationPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.java 7 Sep 2006 12:59:26 -0000 1.35 >+++ search/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.java 24 Aug 2007 05:50:20 -0000 >@@ -23,8 +23,8 @@ > public QualifiedTypeDeclarationPattern(char[] qualification, char[] simpleName, char typeSuffix, int matchRule) { > this(matchRule); > >- this.qualification = isCaseSensitive() ? qualification : CharOperation.toLowerCase(qualification); >- this.simpleName = (isCaseSensitive() || isCamelCase()) ? simpleName : CharOperation.toLowerCase(simpleName); >+ this.qualification = this.isCaseSensitive ? qualification : CharOperation.toLowerCase(qualification); >+ this.simpleName = (this.isCaseSensitive || this.isCamelCase) ? simpleName : CharOperation.toLowerCase(simpleName); > this.typeSuffix = typeSuffix; > > ((InternalSearchPattern)this).mustResolve = this.qualification != null || typeSuffix != TYPE_SUFFIX; >Index: search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java,v >retrieving revision 1.36 >diff -u -r1.36 ConstructorPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java 7 Sep 2006 12:59:26 -0000 1.36 >+++ search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java 24 Aug 2007 05:50:15 -0000 >@@ -73,8 +73,8 @@ > this.findDeclarations = findDeclarations; > this.findReferences = findReferences; > >- this.declaringQualification = isCaseSensitive() ? declaringQualification : CharOperation.toLowerCase(declaringQualification); >- this.declaringSimpleName = (isCaseSensitive() || isCamelCase()) ? declaringSimpleName : CharOperation.toLowerCase(declaringSimpleName); >+ this.declaringQualification = this.isCaseSensitive ? declaringQualification : CharOperation.toLowerCase(declaringQualification); >+ this.declaringSimpleName = (this.isCaseSensitive || this.isCamelCase) ? declaringSimpleName : CharOperation.toLowerCase(declaringSimpleName); > if (parameterSimpleNames != null) { > this.parameterCount = parameterSimpleNames.length; > boolean synthetic = this.parameterCount>0 && declaringQualification != null && CharOperation.equals(CharOperation.concat(parameterQualifications[0], parameterSimpleNames[0], '.'), declaringQualification); >@@ -87,8 +87,8 @@ > this.parameterQualifications = new char[this.parameterCount][]; > this.parameterSimpleNames = new char[this.parameterCount][]; > for (int i = 0; i < this.parameterCount; i++) { >- this.parameterQualifications[i] = isCaseSensitive() ? parameterQualifications[i+offset] : CharOperation.toLowerCase(parameterQualifications[i+offset]); >- this.parameterSimpleNames[i] = isCaseSensitive() ? parameterSimpleNames[i+offset] : CharOperation.toLowerCase(parameterSimpleNames[i+offset]); >+ this.parameterQualifications[i] = this.isCaseSensitive ? parameterQualifications[i+offset] : CharOperation.toLowerCase(parameterQualifications[i+offset]); >+ this.parameterSimpleNames[i] = this.isCaseSensitive ? parameterSimpleNames[i+offset] : CharOperation.toLowerCase(parameterSimpleNames[i+offset]); > } > } else { > this.parameterCount = -1; >Index: search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java,v >retrieving revision 1.60 >diff -u -r1.60 PackageReferencePattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java 4 Jul 2007 13:59:58 -0000 1.60 >+++ search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java 24 Aug 2007 05:50:19 -0000 >@@ -30,7 +30,7 @@ > this.segments = new char[][] {CharOperation.NO_CHAR}; > ((InternalSearchPattern)this).mustResolve = false; > } else { >- this.pkgName = (isCaseSensitive() || isCamelCase()) ? pkgName : CharOperation.toLowerCase(pkgName); >+ this.pkgName = (this.isCaseSensitive || this.isCamelCase) ? pkgName : CharOperation.toLowerCase(pkgName); > this.segments = CharOperation.splitOn('.', this.pkgName); > ((InternalSearchPattern)this).mustResolve = true; > } >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.10 >diff -u -r1.10 MultiTypeDeclarationPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java 16 Oct 2006 15:58:38 -0000 1.10 >+++ search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java 24 Aug 2007 05:50:17 -0000 >@@ -48,7 +48,7 @@ > } > // null simple names are allowed (should return all names) > if (simpleNames != null) { >- if ((isCaseSensitive() || isCamelCase()) ) { >+ if (this.isCaseSensitive || this.isCamelCase) { > this.simpleNames = simpleNames; > } else { > int length = simpleNames.length; >Index: search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java,v >retrieving revision 1.59 >diff -u -r1.59 MethodPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java 7 Sep 2006 12:59:26 -0000 1.59 >+++ search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java 24 Aug 2007 05:50:17 -0000 >@@ -83,18 +83,18 @@ > this.findDeclarations = findDeclarations; > this.findReferences = findReferences; > >- this.selector = (isCaseSensitive() || isCamelCase()) ? selector : CharOperation.toLowerCase(selector); >- this.declaringQualification = isCaseSensitive() ? declaringQualification : CharOperation.toLowerCase(declaringQualification); >- this.declaringSimpleName = isCaseSensitive() ? declaringSimpleName : CharOperation.toLowerCase(declaringSimpleName); >- this.returnQualification = isCaseSensitive() ? returnQualification : CharOperation.toLowerCase(returnQualification); >- this.returnSimpleName = isCaseSensitive() ? returnSimpleName : CharOperation.toLowerCase(returnSimpleName); >+ this.selector = (this.isCaseSensitive || this.isCamelCase) ? selector : CharOperation.toLowerCase(selector); >+ this.declaringQualification = this.isCaseSensitive ? declaringQualification : CharOperation.toLowerCase(declaringQualification); >+ this.declaringSimpleName = this.isCaseSensitive ? declaringSimpleName : CharOperation.toLowerCase(declaringSimpleName); >+ this.returnQualification = this.isCaseSensitive ? returnQualification : CharOperation.toLowerCase(returnQualification); >+ this.returnSimpleName = this.isCaseSensitive ? returnSimpleName : CharOperation.toLowerCase(returnSimpleName); > if (parameterSimpleNames != null) { > this.parameterCount = parameterSimpleNames.length; > this.parameterQualifications = new char[this.parameterCount][]; > this.parameterSimpleNames = new char[this.parameterCount][]; > for (int i = 0; i < this.parameterCount; i++) { >- this.parameterQualifications[i] = isCaseSensitive() ? parameterQualifications[i] : CharOperation.toLowerCase(parameterQualifications[i]); >- this.parameterSimpleNames[i] = isCaseSensitive() ? parameterSimpleNames[i] : CharOperation.toLowerCase(parameterSimpleNames[i]); >+ this.parameterQualifications[i] = this.isCaseSensitive ? parameterQualifications[i] : CharOperation.toLowerCase(parameterQualifications[i]); >+ this.parameterSimpleNames[i] = this.isCaseSensitive ? parameterSimpleNames[i] : CharOperation.toLowerCase(parameterSimpleNames[i]); > } > } else { > this.parameterCount = -1; >Index: search/org/eclipse/jdt/internal/core/search/matching/VariablePattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/VariablePattern.java,v >retrieving revision 1.11 >diff -u -r1.11 VariablePattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/VariablePattern.java 10 May 2006 18:03:42 -0000 1.11 >+++ search/org/eclipse/jdt/internal/core/search/matching/VariablePattern.java 24 Aug 2007 05:50:23 -0000 >@@ -24,12 +24,12 @@ > public VariablePattern(int patternKind, boolean findDeclarations, boolean readAccess, boolean writeAccess, char[] name, int matchRule) { > super(patternKind, matchRule); > >- this.findDeclarations = findDeclarations; // set to find declarations & all occurences >- this.readAccess = readAccess; // set to find any reference, read only references & all occurences >- this.writeAccess = writeAccess; // set to find any reference, write only references & all occurences >+ this.findDeclarations = findDeclarations; // set to find declarations & all occurrences >+ this.readAccess = readAccess; // set to find any reference, read only references & all occurrences >+ this.writeAccess = writeAccess; // set to find any reference, write only references & all occurrences > this.findReferences = readAccess || writeAccess; > >- this.name = (isCaseSensitive() || isCamelCase()) ? name : CharOperation.toLowerCase(name); >+ this.name = (this.isCaseSensitive || this.isCamelCase) ? name : CharOperation.toLowerCase(name); > } > /* > * Returns whether a method declaration or message send will need to be resolved to >Index: search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java,v >retrieving revision 1.56 >diff -u -r1.56 TypeReferenceLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java 27 Apr 2007 15:51:38 -0000 1.56 >+++ search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java 24 Aug 2007 05:50:23 -0000 >@@ -112,8 +112,11 @@ > return IMPOSSIBLE_MATCH; > } > boolean matchFirstChar = !this.isCaseSensitive || (qualifiedPattern[0] == qualifiedTypeName[0]); >- if (this.isCamelCase && matchFirstChar && CharOperation.camelCaseMatch(qualifiedPattern, qualifiedTypeName)) { >- return POSSIBLE_MATCH; >+ if (this.isCamelCase) { >+ if (matchFirstChar && CharOperation.camelCaseMatch(qualifiedPattern, qualifiedTypeName, (this.matchMode & SearchPattern.R_PREFIX_MATCH) != 0)) { >+ return POSSIBLE_MATCH; >+ } >+ if (this.isCaseSensitive) return IMPOSSIBLE_MATCH; > } > switch (this.matchMode) { > case SearchPattern.R_EXACT_MATCH: >Index: search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java,v >retrieving revision 1.59 >diff -u -r1.59 SuperTypeReferencePattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java 7 Sep 2006 12:59:26 -0000 1.59 >+++ search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java 24 Aug 2007 05:50:20 -0000 >@@ -150,8 +150,8 @@ > > this(matchRule); > >- this.superQualification = isCaseSensitive() ? superQualification : CharOperation.toLowerCase(superQualification); >- this.superSimpleName = (isCaseSensitive() || isCamelCase()) ? superSimpleName : CharOperation.toLowerCase(superSimpleName); >+ this.superQualification = this.isCaseSensitive ? superQualification : CharOperation.toLowerCase(superQualification); >+ this.superSimpleName = (this.isCaseSensitive || this.isCamelCase) ? superSimpleName : CharOperation.toLowerCase(superSimpleName); > ((InternalSearchPattern)this).mustResolve = superQualification != null; > this.superRefKind = superRefKind; > } >Index: search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java,v >retrieving revision 1.23 >diff -u -r1.23 JavaSearchPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java 7 Sep 2006 12:59:26 -0000 1.23 >+++ search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java 24 Aug 2007 05:50:17 -0000 >@@ -42,7 +42,7 @@ > * <li>{@link #R_PREFIX_MATCH}</li> > * <li>{@link #R_PATTERN_MATCH}</li> > * <li>{@link #R_REGEXP_MATCH}</li> >- * <li>{@link #R_CAMELCASE_MATCH}</li> >+ * <li>{@link #R_CAMEL_CASE_MATCH}</li> > * </ul> > */ > int matchMode; >@@ -75,7 +75,7 @@ > // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=81377 > int rule = getMatchRule(); > this.isCaseSensitive = (rule & R_CASE_SENSITIVE) != 0; >- this.isCamelCase = (rule & R_CAMELCASE_MATCH) != 0; >+ this.isCamelCase = (rule & R_CAMEL_CASE_MATCH) != 0; > this.matchCompatibility = rule & MATCH_COMPATIBILITY_MASK; > this.matchMode = rule & MATCH_MODE_MASK; > } >@@ -84,23 +84,23 @@ > return null; > } > >- int getMatchMode() { >+ final int getMatchMode() { > return this.matchMode; > } > >- boolean isCamelCase() { >+ final boolean isCamelCase() { > return this.isCamelCase; > } > >- boolean isCaseSensitive () { >+ final boolean isCaseSensitive () { > return this.isCaseSensitive; > } > >- boolean isErasureMatch() { >+ final boolean isErasureMatch() { > return (this.matchCompatibility & R_ERASURE_MATCH) != 0; > } > >- boolean isEquivalentMatch() { >+ final boolean isEquivalentMatch() { > return (this.matchCompatibility & R_EQUIVALENT_MATCH) != 0; > } > >Index: search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java,v >retrieving revision 1.38 >diff -u -r1.38 PackageReferenceLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java 27 Apr 2007 15:51:38 -0000 1.38 >+++ search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java 24 Aug 2007 05:50:19 -0000 >@@ -98,9 +98,10 @@ > char[] packageName = null; > if (this.isCamelCase) { > packageName = CharOperation.concatWith(tokens, '.'); >- if (CharOperation.camelCaseMatch(this.pattern.pkgName, packageName)) { >+ if (CharOperation.camelCaseMatch(this.pattern.pkgName, packageName, (this.matchMode & SearchPattern.R_PREFIX_MATCH) != 0)) { > return POSSIBLE_MATCH; > } >+ if (this.isCaseSensitive) return IMPOSSIBLE_MATCH; > } > switch (this.matchMode) { > case SearchPattern.R_EXACT_MATCH: >Index: search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java,v >retrieving revision 1.61 >diff -u -r1.61 TypeDeclarationPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java 7 Sep 2006 12:59:26 -0000 1.61 >+++ search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java 24 Aug 2007 05:50:22 -0000 >@@ -140,8 +140,8 @@ > > this(matchRule); > >- this.pkg = isCaseSensitive() ? pkg : CharOperation.toLowerCase(pkg); >- if (isCaseSensitive() || enclosingTypeNames == null) { >+ this.pkg = this.isCaseSensitive ? pkg : CharOperation.toLowerCase(pkg); >+ if (this.isCaseSensitive || enclosingTypeNames == null) { > this.enclosingTypeNames = enclosingTypeNames; > } else { > int length = enclosingTypeNames.length; >@@ -149,7 +149,7 @@ > for (int i = 0; i < length; i++) > this.enclosingTypeNames[i] = CharOperation.toLowerCase(enclosingTypeNames[i]); > } >- this.simpleName = (isCaseSensitive() || isCamelCase()) ? simpleName : CharOperation.toLowerCase(simpleName); >+ this.simpleName = (this.isCaseSensitive || this.isCamelCase) ? simpleName : CharOperation.toLowerCase(simpleName); > this.typeSuffix = typeSuffix; > > ((InternalSearchPattern)this).mustResolve = (this.pkg != null && this.enclosingTypeNames != null) || typeSuffix != TYPE_SUFFIX; >Index: search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java,v >retrieving revision 1.66 >diff -u -r1.66 PatternLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java 4 Jul 2007 13:59:58 -0000 1.66 >+++ search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java 24 Aug 2007 05:50:20 -0000 >@@ -118,7 +118,7 @@ > public PatternLocator(SearchPattern pattern) { > int matchRule = pattern.getMatchRule(); > this.isCaseSensitive = (matchRule & SearchPattern.R_CASE_SENSITIVE) != 0; >- this.isCamelCase = (matchRule & SearchPattern.R_CAMELCASE_MATCH) != 0; >+ this.isCamelCase = (matchRule & SearchPattern.R_CAMEL_CASE_MATCH) != 0; > this.isErasureMatch = (matchRule & SearchPattern.R_ERASURE_MATCH) != 0; > this.isEquivalentMatch = (matchRule & SearchPattern.R_EQUIVALENT_MATCH) != 0; > this.matchMode = matchRule & JavaSearchPattern.MATCH_MODE_MASK; >@@ -282,24 +282,25 @@ > boolean matchFirstChar = !this.isCaseSensitive || pattern[0] == name[0]; > boolean sameLength = pattern.length == name.length; > boolean canBePrefix = name.length >= pattern.length; >- if (this.isCamelCase && matchFirstChar && CharOperation.camelCaseMatch(pattern, name)) { >- return POSSIBLE_MATCH; >+ if (this.isCamelCase) { >+ if (matchFirstChar && CharOperation.camelCaseMatch(pattern, name, (this.matchMode & SearchPattern.R_PREFIX_MATCH) != 0)) { >+ return POSSIBLE_MATCH; >+ } >+ if (this.isCaseSensitive) return IMPOSSIBLE_MATCH; > } > switch (this.matchMode) { > case SearchPattern.R_EXACT_MATCH: >- if (!this.isCamelCase) { >- if (sameLength && matchFirstChar && CharOperation.equals(pattern, name, this.isCaseSensitive)) { >- return POSSIBLE_MATCH | EXACT_FLAVOR; >- } >- break; >+ if (sameLength && matchFirstChar && CharOperation.equals(pattern, name, this.isCaseSensitive)) { >+ return POSSIBLE_MATCH | EXACT_FLAVOR; > } >- // fall through next case to match as prefix if camel case failed >+ break; > case SearchPattern.R_PREFIX_MATCH: > if (canBePrefix && matchFirstChar && CharOperation.prefixEquals(pattern, name, this.isCaseSensitive)) { > return POSSIBLE_MATCH; > } > break; > case SearchPattern.R_PATTERN_MATCH: >+ // TODO_PERFS (frederic) Not sure this lowercase is necessary > if (!this.isCaseSensitive) { > pattern = CharOperation.toLowerCase(pattern); > } >@@ -717,13 +718,13 @@ > } > } > if (this.isCamelCase) { >- if (!this.isCaseSensitive || (qualifiedPattern.length>0 && sourceName.length>0 && qualifiedPattern[0] == sourceName[0])) { >- if (CharOperation.camelCaseMatch(qualifiedPattern, sourceName)) { >+ if ((qualifiedPattern.length>0 && sourceName.length>0 && qualifiedPattern[0] == sourceName[0])) { >+ if (CharOperation.camelCaseMatch(qualifiedPattern, sourceName, (this.matchMode & SearchPattern.R_PREFIX_MATCH) != 0)) { > return ACCURATE_MATCH; > } > } >- if (this.matchMode == SearchPattern.R_EXACT_MATCH) { >- boolean matchPattern = CharOperation.prefixEquals(qualifiedPattern, sourceName, this.isCaseSensitive); >+ if (!this.isCaseSensitive && this.matchMode == SearchPattern.R_EXACT_MATCH) { >+ boolean matchPattern = CharOperation.equals(qualifiedPattern, sourceName, false); > return matchPattern ? ACCURATE_MATCH : IMPOSSIBLE_MATCH; > } > } >Index: search/org/eclipse/jdt/internal/core/search/matching/AndPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/AndPattern.java,v >retrieving revision 1.29 >diff -u -r1.29 AndPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/AndPattern.java 4 Jul 2007 13:59:58 -0000 1.29 >+++ search/org/eclipse/jdt/internal/core/search/matching/AndPattern.java 24 Aug 2007 05:50:15 -0000 >@@ -31,7 +31,7 @@ > return (combined & (R_EXACT_MATCH | R_PREFIX_MATCH | R_PATTERN_MATCH | R_REGEXP_MATCH)) > | (combined & R_CASE_SENSITIVE) > | compatibility >- | (combined & R_CAMELCASE_MATCH); >+ | (combined & R_CAMEL_CASE_MATCH); > } > > public AndPattern(SearchPattern leftPattern, SearchPattern rightPattern) { >Index: search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java,v >retrieving revision 1.28 >diff -u -r1.28 FieldPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java 6 Mar 2007 02:38:49 -0000 1.28 >+++ search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java 24 Aug 2007 05:50:15 -0000 >@@ -46,15 +46,15 @@ > > super(FIELD_PATTERN, findDeclarations, readAccess, writeAccess, name, matchRule); > >- this.declaringQualification = isCaseSensitive() ? declaringQualification : CharOperation.toLowerCase(declaringQualification); >- this.declaringSimpleName = isCaseSensitive() ? declaringSimpleName : CharOperation.toLowerCase(declaringSimpleName); >- this.typeQualification = isCaseSensitive() ? typeQualification : CharOperation.toLowerCase(typeQualification); >- this.typeSimpleName = (isCaseSensitive() || isCamelCase()) ? typeSimpleName : CharOperation.toLowerCase(typeSimpleName); >+ this.declaringQualification = this.isCaseSensitive ? declaringQualification : CharOperation.toLowerCase(declaringQualification); >+ this.declaringSimpleName = this.isCaseSensitive ? declaringSimpleName : CharOperation.toLowerCase(declaringSimpleName); >+ this.typeQualification = this.isCaseSensitive ? typeQualification : CharOperation.toLowerCase(typeQualification); >+ this.typeSimpleName = (this.isCaseSensitive || this.isCamelCase) ? typeSimpleName : CharOperation.toLowerCase(typeSimpleName); > > ((InternalSearchPattern)this).mustResolve = mustResolve(); > } > /* >- * Instanciate a field pattern with additional information for generics search >+ * Instantiate a field pattern with additional information for generic search > */ > public FieldPattern( > boolean findDeclarations, >Index: buildnotes_jdt-core.html >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/buildnotes_jdt-core.html,v >retrieving revision 1.6037 >diff -u -r1.6037 buildnotes_jdt-core.html >--- buildnotes_jdt-core.html 23 Aug 2007 18:51:56 -0000 1.6037 >+++ buildnotes_jdt-core.html 24 Aug 2007 05:49:56 -0000 >@@ -46,9 +46,285 @@ > <br>Project org.eclipse.jdt.core v_809 > (<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/?only_with_tag=v_809">cvs</a>). > <h2>What's new in this drop</h2> >+<ul> >+<li>Prefix matching can be disabled while using Camel Case API methods. (see >+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=124624">bug 124624</a>).<br> >+Following API methods have been added on <code>org.eclipse.jdt.core.compiler.CharOperation</code>: >+<pre> >+/** >+ * Answers true if the pattern matches the given name using CamelCase rules, or >+ * false otherwise. char[] CamelCase matching does NOT accept explicit wild-cards >+ * '*' and '?' and is inherently case sensitive. >+ * >+ * CamelCase denotes the convention of writing compound names without spaces, >+ * and capitalizing every term. This function recognizes both upper and lower >+ * CamelCase, depending whether the leading character is capitalized or not. >+ * The leading part of an upper CamelCase pattern is assumed to contain a >+ * sequence of capitals which are appearing in the matching name; e.g. 'NPE' will >+ * match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern >+ * uses a lowercase first character. In Java, type names follow the upper >+ * CamelCase convention, whereas method or field names follow the lower >+ * CamelCase convention. >+ * >+ * The pattern may contain lowercase characters, which will be match in a case >+ * sensitive way. These characters must appear in sequence in the name. >+ * For instance, 'NPExcep' will match 'NullPointerException', but not >+ * 'NullPointerExCEPTION' or 'NuPoEx' will match 'NullPointerException', but not >+ * 'NoPointerException'. >+ * >+ * Digit characters are treated in a special way. They can be used in the pattern >+ * but are not always considered as leading character. For instance, both >+ * 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'. >+ * >+ * CamelCase may or may not match prefixes depending on the given parameter. >+ * When the prefix match parameter is <code>true</code>, the given pattern can >+ * match only a prefix of the given name. For instance, 'HM' , 'HaMa' and 'HMap' >+ * patterns will all match 'HashMap', 'HatMapper' <b>and</b> 'HashMapEntry'. >+ * Reversely, if the prefix match parameter is <code>false</code>, then pattern >+ * and name must have <b>exactly</b> the same number of parts, and their last >+ * parts must be identical if they contain lowercase characters. >+ * For instance, 'HMap' and 'HaMap' patterns will match 'HashMap' but neither >+ * 'HashMapEntry' nor 'HatMapper'. Note that when the last part does not contain >+ * lowercase characters, then the name may end with lowercase characters. >+ * So, 'HM' pattern will match both 'HashMap' <b>and</b> 'HatMapper' but will not >+ * match 'HashMapEntry'. >+ * >+ * Examples: >+ * 1. pattern = { 'N', 'P', 'E' } >+ * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * result => true >+ * 2. pattern = { 'N', 'P', 'E' } >+ * name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * result => true >+ * 3. pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } >+ * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * result => true >+ * 4. pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } >+ * name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * result => false >+ * 5. pattern = { 'n', p', 'e' } >+ * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * result => false >+ * 6. pattern = { 'I', 'P', 'L', '3' } >+ * name = { 'I', 'P', 'e', 'r', 's', 'p', 'e', 'c', 't', 'i', 'v', 'e', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '3' } >+ * result => true >+ * 7. pattern = { 'H', M' } >+ * name = { 'H', 'a', 's', 'h', 'M', 'a', 'p', 'E', 'n', 't', 'r', 'y' } >+ * result => (prefixMatch == true) >+ * 8. pattern = { 'H', M', 'a', 'p' } >+ * name = { 'H', 'a', 't', 'M', 'a', 'p', 'p', 'e', 'r' } >+ * result => (prefixMatch == true) >+ * >+ * @param pattern the given pattern >+ * @param name the given name >+ * @param prefixMatch flag telling whether the pattern can match name prefix or not. >+ * . For example, when it's <code>true</code>: >+ * - 'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types, >+ * but not 'HashMapEntry' >+ * - 'HMap' type string pattern will match 'HashMap' type but not 'HtmlMapper'. >+ * . and, when it's <code>false</code>: >+ * - 'HM' type string pattern will match both 'HashMap' and 'HtmlMapper' >+ * and 'HashMapEntry' >+ * - 'HMap' type string pattern will match both 'HashMap' and 'HtmlMapper' >+ * types. >+ * >+ * @return true if the pattern matches the given name, false otherwise >+ * @since 3.4 >+ */ >+public static final boolean camelCaseMatch(char[] pattern, char[] name, boolean prefixMatch) { >+... >+} >+ >+/** >+ * Answers true if a sub-pattern matches the sub-part of the given name using >+ * CamelCase rules, or false otherwise. char[] CamelCase matching does NOT >+ * accept explicit wild-cards '*' and '?' and is inherently case sensitive. >+ * Can match only subset of name/pattern, considering end positions as >+ * non-inclusive. The sub-pattern is defined by the patternStart and patternEnd >+ * positions. >+ * >+ * CamelCase denotes the convention of writing compound names without spaces, >+ * and capitalizing every term. This function recognizes both upper and lower >+ * CamelCase, depending whether the leading character is capitalized or not. >+ * The leading part of an upper CamelCase pattern is assumed to contain >+ * a sequence of capitals which are appearing in the matching name; e.g. 'NPE' will >+ * match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern >+ * uses a lowercase first character. In Java, type names follow the upper >+ * CamelCase convention, whereas method or field names follow the lower >+ * CamelCase convention. >+ * >+ * The pattern may contain lowercase characters, which will be match in a case >+ * sensitive way. These characters must appear in sequence in the name. >+ * For instance, 'NPExcep' will match 'NullPointerException', but not >+ * 'NullPointerExCEPTION' or 'NuPoEx' will match 'NullPointerException', but not >+ * 'NoPointerException'. >+ * >+ * Digit characters are treated in a special way. They can be used in the pattern >+ * but are not always considered as leading character. For instance, both >+ * 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'. >+ * >+ * CamelCase may or may not match prefixes depending on the given parameter. >+ * When the prefix match parameter is <code>true</code>, the given pattern can >+ * match only a prefix of the given name. For instance, 'HM' , 'HaMa' and 'HMap' >+ * patterns will all match 'HashMap', 'HatMapper' <b>and</b> 'HashMapEntry'. >+ * Reversely, if the prefix match parameter is <code>false</code>, then pattern >+ * and name must have <b>exactly</b> the same number of parts, and their last >+ * parts must be identical if they contain lowercase characters. >+ * For instance, 'HMap' and 'HaMap' patterns will match 'HashMap' but neither >+ * 'HashMapEntry' nor 'HatMapper'. Note that when the last part does not contain >+ * lowercase characters, then the name may end with lowercase characters. >+ * So, 'HM' pattern will match both 'HashMap' <b>and</b> 'HatMapper' but will not >+ * match 'HashMapEntry'. >+ * >+ * Examples: >+ * 1. pattern = { 'N', 'P', 'E' } >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * nameStart = 0 >+ * nameEnd = 20 >+ * result => true >+ * 2. pattern = { 'N', 'P', 'E' } >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * nameStart = 0 >+ * nameEnd = 21 >+ * result => true >+ * 3. pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } >+ * patternStart = 0 >+ * patternEnd = 6 >+ * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * nameStart = 0 >+ * nameEnd = 20 >+ * result => true >+ * 4. pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } >+ * patternStart = 0 >+ * patternEnd = 6 >+ * name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * nameStart = 0 >+ * nameEnd = 21 >+ * result => false >+ * 5. pattern = { 'n', p', 'e' } >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * nameStart = 20 >+ * nameEnd = 9 >+ * result => false >+ * 6. pattern = { 'I', 'P', 'L', '3' } >+ * patternStart = 0 >+ * patternEnd = 4 >+ * name = { 'I', 'P', 'e', 'r', 's', 'p', 'e', 'c', 't', 'i', 'v', 'e', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '3' } >+ * nameStart = 0 >+ * nameEnd = 21 >+ * result => true >+ * 7. pattern = { 'H', M' } >+ * patternStart = 0 >+ * patternEnd = 2 >+ * name = { 'H', 'a', 's', 'h', 'M', 'a', 'p', 'E', 'n', 't', 'r', 'y' } >+ * nameStart = 0 >+ * nameEnd = 12 >+ * result => (prefixMatch == true) >+ * 8. pattern = { 'H', M', 'a', 'p' } >+ * patternStart = 0 >+ * patternEnd = 4 >+ * name = { 'H', 'a', 't', 'M', 'a', 'p', 'p', 'e', 'r' } >+ * nameStart = 0 >+ * nameEnd = 9 >+ * result => (prefixMatch == true) >+ * >+ * @param pattern the given pattern >+ * @param patternStart the start index of the pattern, inclusive >+ * @param patternEnd the end index of the pattern, exclusive >+ * @param name the given name >+ * @param nameStart the start index of the name, inclusive >+ * @param nameEnd the end index of the name, exclusive >+ * @param prefixMatch flag telling whether the pattern can match name prefix or not. >+ * . For example, when it's <code>true</code>: >+ * - 'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types, >+ * but not 'HashMapEntry' >+ * - 'HMap' type string pattern will match 'HashMap' type but not 'HtmlMapper'. >+ * . and, when it's <code>false</code>: >+ * - 'HM' type string pattern will match both 'HashMap' and 'HtmlMapper' >+ * and 'HashMapEntry' >+ * - 'HMap' type string pattern will match both 'HashMap' and 'HtmlMapper' >+ * types. >+ * >+ * @return true if a sub-pattern matches the sub-part of the given name, false otherwise >+ * @since 3.4 >+ */ >+public static final boolean camelCaseMatch(char[] pattern, int patternStart, int patternEnd, char[] name, int nameStart, int nameEnd, boolean prefixMatch) { >+... >+} >+</pre> >+Note that same methods have been added on <code>SearchPattern</code> but with >+<code>String</code> parameters instead of <code>char[]</code> ones (javadoc comments >+are identical): >+<pre> >+public static final boolean camelCaseMatch(String pattern, String name, boolean prefixMatch) { >+... >+} >+public static final boolean camelCaseMatch(String pattern, int patternStart, int patternEnd, String name, int nameStart, int nameEnd, boolean prefixMatch) { >+... >+} >+</pre> >+Note also that methods <code>camelCaseMatch(String, int, int, String, int, int)</code> >+of <code>CharOperation</code> and <code>SearchPattern</code> classes have been >+depreciated to avoid too many 'camelCaseMatch*' methods on these classes. >+</li> >+<li>Search Engine has been modified to better handle additional <code>SearchPattern</code> >+constants while using Camel Case one (see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=200400">bug 200400</a>).<br> >+Existing <code>SearchPattern#R_CAMELCASE_MATCH</code> constant has been depreciated and<br> >+is <b>now replaced by <code>SearchPattern#R_CAMEL_CASE_MATCH</code></b>:<pre> >+ /** >+ * Match rule: The search pattern contains a Camel Case expression with >+ * a strict number of parts and preventing automatic prefix matching for the last >+ * part (if it consists of multiple letters). >+ * >+ * Examples: >+ * . 'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types, >+ * but not 'HashMapEntry' >+ * . 'HMap' type string pattern will match 'HashMap' type but not 'HtmlMapper'. >+ * >+ * This Camel Case match rule does not allow prefix match but accept insensitive >+ * case. For instance, 'HashMap' or 'HASHMAP' patterns using this Camel Case >+ * rule will match both 'HashMap' but not 'HashMapEntry'. >+ * >+ * This rule still can be combined to prefix match to accept prefix matches >+ * ('HashMap' pattern matching 'HashMapEntry' name). It can also be combined >+ * to case sensitive match to reject case insensitive matches ('HAMA' pattern >+ * will not match 'HashMap' name). >+ * >+ * If {@link #R_PATTERN_MATCH} rule is also combined, then the real used >+ * match rule will depend on whether string pattern contains specific pattern >+ * characters (e.g. '*' or '?') or not. If it does, then only Pattern match rule will >+ * be used, otherwise only Camel Case match will be used. >+ * For example, with 'NPE' string pattern, search will only use >+ * Camel Case match rule, but with 'N*P*E*' string pattern, it will >+ * use only Pattern match rule. >+ * >+ * @see CharOperation#camelCaseMatch(char[], char[], boolean) for a detailed >+ * explanation of Camel Case matching. >+ * >+ * @since 3.4 >+ */ >+ public static final int R_CAMEL_CASE_MATCH = 0x0100; >+</pre> >+This change was necessary has the obsolete <code>R_CAMELCASE_MATCH</code> could >+not support correctly additional constants as <code>R_PREFIX_MATCH</code> or >+<code>R_CASE_SENSITIVE</code>.<br> >+However, this depreciated constant is still accepted for backward compatibility >+but user is advised to replace it with <code>R_CAMEL_CASE_MATCH | R_PREFIX_MATCH</code> >+</li> >+</ul> > > <h3>Problem Reports Fixed</h3> >-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=191739">191739</a> >+<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 >+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=124624">124624</a> >+[search] Camelcase matching routines should support end character >+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=191739">191739</a> > "Duplicate nested type" bogus error on static class of abstract class or interface > <br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=200931">200931</a> > GENERATED_BY references still exist in some javadoc comments >Index: compiler/org/eclipse/jdt/core/compiler/CharOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CharOperation.java,v >retrieving revision 1.78 >diff -u -r1.78 CharOperation.java >--- compiler/org/eclipse/jdt/core/compiler/CharOperation.java 16 Aug 2007 13:13:13 -0000 1.78 >+++ compiler/org/eclipse/jdt/core/compiler/CharOperation.java 24 Aug 2007 05:50:02 -0000 >@@ -58,7 +58,7 @@ > * </pre></li> > * </ol> > * >- * @param array the array that is concanated with the suffix character >+ * @param array the array that is concatenated with the suffix character > * @param suffix the suffix character > * @return the new array > */ >@@ -72,8 +72,8 @@ > } > > /** >- * Append the given subarray to the target array starting at the given index in the target array. >- * The start of the subarray is inclusive, the end is exclusive. >+ * Append the given sub-array to the target array starting at the given index in the target array. >+ * The start of the sub-array is inclusive, the end is exclusive. > * Answers a new target array if it needs to grow, otherwise answers the same target array. > * <br> > * For example:<br> >@@ -178,53 +178,60 @@ > } > > /** >- * Answers true if the pattern matches the given name using CamelCase rules, or false otherwise. >- * char[] CamelCase matching does NOT accept explicit wild-cards '*' and '?' and is inherently case sensitive. >- * <br> >- * CamelCase denotes the convention of writing compound names without spaces, and capitalizing every term. >- * This function recognizes both upper and lower CamelCase, depending whether the leading character is capitalized >- * or not. The leading part of an upper CamelCase pattern is assumed to contain a sequence of capitals which are appearing >- * in the matching name; e.g. 'NPE' will match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern >- * uses a lowercase first character. In Java, type names follow the upper CamelCase convention, whereas method or field >- * names follow the lower CamelCase convention. >- * <br> >- * The pattern may contain lowercase characters, which will be match in a case sensitive way. These characters must >- * appear in sequence in the name. For instance, 'NPExcep' will match 'NullPointerException', but not 'NullPointerExCEPTION' >- * or 'NuPoEx' will match 'NullPointerException', but not 'NoPointerException'. >- * <br><br> >- * Examples: >- * <ol> >- * <li><pre> >- * pattern = { 'N', 'P', 'E' } >- * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >- * result => true >- * </pre> >- * </li> >- * <li><pre> >- * pattern = { 'N', 'P', 'E' } >- * name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >- * result => true >- * </pre> >- * </li> >- * <li><pre> >- * pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } >- * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >- * result => true >- * </pre> >- * </li> >- * <li><pre> >- * pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } >- * name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >- * result => false >- * </pre> >- * </li> >- * <li><pre> >- * pattern = { 'n', p', 'e' } >- * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >- * result => false >- * </pre> >- * </li> >- * </ol> >+ * Answers true if the pattern matches the given name using CamelCase rules, or >+ * false otherwise. char[] CamelCase matching does NOT accept explicit wild-cards >+ * '*' and '?' and is inherently case sensitive. >+ * <p> >+ * CamelCase denotes the convention of writing compound names without spaces, >+ * and capitalizing every term. This function recognizes both upper and lower >+ * CamelCase, depending whether the leading character is capitalized or not. >+ * The leading part of an upper CamelCase pattern is assumed to contain a >+ * sequence of capitals which are appearing in the matching name; e.g. 'NPE' will >+ * match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern >+ * uses a lowercase first character. In Java, type names follow the upper >+ * CamelCase convention, whereas method or field names follow the lower >+ * CamelCase convention. >+ * <p> >+ * The pattern may contain lowercase characters, which will be matched in a case >+ * sensitive way. These characters must appear in sequence in the name. >+ * For instance, 'NPExcep' will match 'NullPointerException', but not >+ * 'NullPointerExCEPTION' or 'NuPoEx' will match 'NullPointerException', but not >+ * 'NoPointerException'. >+ * <p> >+ * Digit characters are treated in a special way. They can be used in the pattern >+ * but are not always considered as leading character. For instance, both >+ * 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'. >+ * <p> >+ * This method allows prefix match in Camel Case (see >+ * {@link #camelCaseMatch(char[], char[], boolean)}). >+ * <p> >+ * <pre> >+ * Examples:<ol> >+ * <li> pattern = { 'N', 'P', 'E' } >+ * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * result => true</li> >+ * <li> pattern = { 'N', 'P', 'E' } >+ * name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * result => true</li> >+ * <li> pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } >+ * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * result => true</li> >+ * <li> pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } >+ * name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * result => false</li> >+ * <li> pattern = { 'n', p', 'e' } >+ * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * result => false</li> >+ * <li> pattern = { 'I', 'P', 'L', '3' } >+ * name = { 'I', 'P', 'e', 'r', 's', 'p', 'e', 'c', 't', 'i', 'v', 'e', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '3' } >+ * result => true</li> >+ * <li> pattern = { 'H', M' } >+ * name = { 'H', 'a', 's', 'h', 'M', 'a', 'p', 'E', 'n', 't', 'r', 'y' } >+ * result => true</li> >+ * <li>pattern = { 'H', M', 'a', 'p' } >+ * name = { 'H', 'a', 't', 'M', 'a', 'p', 'p', 'e', 'r' } >+ * result => true</li> >+ * </ol></pre> > * > * @param pattern the given pattern > * @param name the given name >@@ -237,26 +244,138 @@ > if (name == null) > return false; // null name cannot match > >- return camelCaseMatch(pattern, 0, pattern.length, name, 0, name.length); >+ return camelCaseMatch(pattern, 0, pattern.length, name, 0, name.length, true/*prefix match*/); > } > > /** >- * Answers true if a sub-pattern matches the subpart of the given name using CamelCase rules, or false otherwise. >- * char[] CamelCase matching does NOT accept explicit wild-cards '*' and '?' and is inherently case sensitive. >+ * Answers true if the pattern matches the given name using CamelCase rules, or >+ * false otherwise. char[] CamelCase matching does NOT accept explicit wild-cards >+ * '*' and '?' and is inherently case sensitive. >+ * <p> >+ * CamelCase denotes the convention of writing compound names without spaces, >+ * and capitalizing every term. This function recognizes both upper and lower >+ * CamelCase, depending whether the leading character is capitalized or not. >+ * The leading part of an upper CamelCase pattern is assumed to contain a >+ * sequence of capitals which are appearing in the matching name; e.g. 'NPE' will >+ * match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern >+ * uses a lowercase first character. In Java, type names follow the upper >+ * CamelCase convention, whereas method or field names follow the lower >+ * CamelCase convention. >+ * <p> >+ * The pattern may contain lowercase characters, which will be matched in a case >+ * sensitive way. These characters must appear in sequence in the name. >+ * For instance, 'NPExcep' will match 'NullPointerException', but not >+ * 'NullPointerExCEPTION' or 'NuPoEx' will match 'NullPointerException', but not >+ * 'NoPointerException'. >+ * <p> >+ * Digit characters are treated in a special way. They can be used in the pattern >+ * but are not always considered as leading character. For instance, both >+ * 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'. >+ * <p> >+ * CamelCase may or may not match prefixes depending on the given parameter. >+ * When the prefix match parameter is <code>true</code>, the given pattern can >+ * match only a prefix of the given name. For instance, 'HM' , 'HaMa' and 'HMap' >+ * patterns will all match 'HashMap', 'HatMapper' <b>and</b> 'HashMapEntry'. >+ * <br> >+ * Reversely, if the prefix match parameter is <code>false</code>, then pattern >+ * and name must have <b>exactly</b> the same number of parts, and their last >+ * parts must be identical if they contain lowercase characters. >+ * For instance, 'HMap' and 'HaMap' patterns will match 'HashMap' but neither >+ * 'HashMapEntry' nor 'HatMapper'. Note that when the last part does not contain >+ * lowercase characters, then the name may end with lowercase characters. >+ * So, 'HM' pattern will match both 'HashMap' <b>and</b> 'HatMapper' but will not >+ * match 'HashMapEntry'. >+ * <p> >+ * <pre> >+ * Examples:<ol> >+ * <li> pattern = { 'N', 'P', 'E' } >+ * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * result => true</li> >+ * <li> pattern = { 'N', 'P', 'E' } >+ * name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * result => true</li> >+ * <li> pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } >+ * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * result => true</li> >+ * <li> pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } >+ * name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * result => false</li> >+ * <li> pattern = { 'n', p', 'e' } >+ * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * result => false</li> >+ * <li> pattern = { 'I', 'P', 'L', '3' } >+ * name = { 'I', 'P', 'e', 'r', 's', 'p', 'e', 'c', 't', 'i', 'v', 'e', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '3' } >+ * result => true</li> >+ * <li> pattern = { 'H', M' } >+ * name = { 'H', 'a', 's', 'h', 'M', 'a', 'p', 'E', 'n', 't', 'r', 'y' } >+ * result => (prefixMatch == true)</li> >+ * <li> pattern = { 'H', M', 'a', 'p' } >+ * name = { 'H', 'a', 't', 'M', 'a', 'p', 'p', 'e', 'r' } >+ * result => (prefixMatch == true)</li> >+ * </ol></pre> >+ * >+ * @param pattern the given pattern >+ * @param name the given name >+ * @param prefixMatch flag telling whether the pattern can match name prefix or not. >+ * <ul> >+ * <li>For example, when it's <code>true</code>:<br> >+ * - 'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types, >+ * but not 'HashMapEntry'<br> >+ * - 'HMap' type string pattern will match 'HashMap' type but not 'HtmlMapper'. >+ * </li> >+ * <li>and, when it's <code>false</code>:<br> >+ * - 'HM' type string pattern will match both 'HashMap' and 'HtmlMapper' >+ * and 'HashMapEntry'<br> >+ * - 'HMap' type string pattern will match both 'HashMap' and 'HtmlMapper' >+ * types. >+ * </li> >+ * </ul> >+ * @return true if the pattern matches the given name, false otherwise >+ * @since 3.4 >+ */ >+public static final boolean camelCaseMatch(char[] pattern, char[] name, boolean prefixMatch) { >+ if (pattern == null) >+ return true; // null pattern is equivalent to '*' >+ if (name == null) >+ return false; // null name cannot match >+ >+ return camelCaseMatch(pattern, 0, pattern.length, name, 0, name.length, prefixMatch); >+} >+ >+/** >+ * Answers true if a sub-pattern matches the sub-part of the given name using >+ * CamelCase rules, or false otherwise. char[] CamelCase matching does NOT >+ * accept explicit wild-cards '*' and '?' and is inherently case sensitive. > * Can match only subset of name/pattern, considering end positions as non-inclusive. >- * The subpattern is defined by the patternStart and patternEnd positions. >- * <br> >- * CamelCase denotes the convention of writing compound names without spaces, and capitalizing every term. >- * This function recognizes both upper and lower CamelCase, depending whether the leading character is capitalized >- * or not. The leading part of an upper CamelCase pattern is assumed to contain a sequence of capitals which are appearing >- * in the matching name; e.g. 'NPE' will match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern >- * uses a lowercase first character. In Java, type names follow the upper CamelCase convention, whereas method or field >- * names follow the lower CamelCase convention. >- * <br> >- * The pattern may contain lowercase characters, which will be match in a case sensitive way. These characters must >- * appear in sequence in the name. For instance, 'NPExcep' will match 'NullPointerException', but not 'NullPointerExCEPTION' >- * or 'NuPoEx' will match 'NullPointerException', but not 'NoPointerException'. >- * <br><br> >+ * The sub-pattern is defined by the patternStart and patternEnd positions. >+ * <p> >+ * CamelCase denotes the convention of writing compound names without spaces, >+ * and capitalizing every term. This function recognizes both upper and lower >+ * CamelCase, depending whether the leading character is capitalized or not. >+ * The leading part of an upper CamelCase pattern is assumed to contain a >+ * sequence of capitals which are appearing in the matching name; e.g. 'NPE' will >+ * match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern >+ * uses a lowercase first character. In Java, type names follow the upper >+ * CamelCase convention, whereas method or field names follow the lower >+ * CamelCase convention. >+ * <p> >+ * The pattern may contain lowercase characters, which will be matched in a case >+ * sensitive way. These characters must appear in sequence in the name. >+ * For instance, 'NPExcep' will match 'NullPointerException', but not >+ * 'NullPointerExCEPTION' or 'NuPoEx' will match 'NullPointerException', but not >+ * 'NoPointerException'. >+ * <p> >+ * Digit characters are treated in a special way. They can be used in the pattern >+ * but are not always considered as leading character. For instance, both >+ * 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'. >+ * <p> >+ * Digit characters are treated in a special way. They can be used in the pattern >+ * but are not always considered as leading character. For instance, both >+ * 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'. >+ * <p> >+ * This method allows prefix match in Camel Case (see >+ * {@link #camelCaseMatch(char[], int, int, char[], int, int, boolean)}). >+ * <p> > * Examples: > * <ol> > * <li><pre> >@@ -309,6 +428,16 @@ > * result => false > * </pre> > * </li> >+ * <li><pre> >+ * pattern = { 'I', 'P', 'L', '3' } >+ * patternStart = 0 >+ * patternEnd = 4 >+ * name = { 'I', 'P', 'e', 'r', 's', 'p', 'e', 'c', 't', 'i', 'v', 'e', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '3' } >+ * nameStart = 0 >+ * nameEnd = 21 >+ * result => true >+ * </pre> >+ * </li> > * </ol> > * > * @param pattern the given pattern >@@ -317,10 +446,141 @@ > * @param name the given name > * @param nameStart the start index of the name, inclusive > * @param nameEnd the end index of the name, exclusive >- * @return true if a sub-pattern matches the subpart of the given name, false otherwise >+ * @return true if a sub-pattern matches the sub-part of the given name, false otherwise > * @since 3.2 > */ > public static final boolean camelCaseMatch(char[] pattern, int patternStart, int patternEnd, char[] name, int nameStart, int nameEnd) { >+ return camelCaseMatch(pattern, patternStart, patternEnd, name, nameStart, nameEnd, true/*prefix match*/); >+} >+ >+/** >+ * Answers true if a sub-pattern matches the sub-part of the given name using >+ * CamelCase rules, or false otherwise. char[] CamelCase matching does NOT >+ * accept explicit wild-cards '*' and '?' and is inherently case sensitive. >+ * Can match only subset of name/pattern, considering end positions as >+ * non-inclusive. The sub-pattern is defined by the patternStart and patternEnd >+ * positions. >+ * <p> >+ * CamelCase denotes the convention of writing compound names without spaces, >+ * and capitalizing every term. This function recognizes both upper and lower >+ * CamelCase, depending whether the leading character is capitalized or not. >+ * The leading part of an upper CamelCase pattern is assumed to contain >+ * a sequence of capitals which are appearing in the matching name; e.g. 'NPE' will >+ * match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern >+ * uses a lowercase first character. In Java, type names follow the upper >+ * CamelCase convention, whereas method or field names follow the lower >+ * CamelCase convention. >+ * <p> >+ * The pattern may contain lowercase characters, which will be matched in a case >+ * sensitive way. These characters must appear in sequence in the name. >+ * For instance, 'NPExcep' will match 'NullPointerException', but not >+ * 'NullPointerExCEPTION' or 'NuPoEx' will match 'NullPointerException', but not >+ * 'NoPointerException'. >+ * <p> >+ * Digit characters are treated in a special way. They can be used in the pattern >+ * but are not always considered as leading character. For instance, both >+ * 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'. >+ * <p> >+ * CamelCase may or may not match prefixes depending on the given parameter. >+ * When the prefix match parameter is <code>true</code>, the given pattern can >+ * match only a prefix of the given name. For instance, 'HM' , 'HaMa' and 'HMap' >+ * patterns will all match 'HashMap', 'HatMapper' <b>and</b> 'HashMapEntry'. >+ * <br> >+ * Reversely, if the prefix match parameter is <code>false</code>, then pattern >+ * and name must have <b>exactly</b> the same number of parts, and their last >+ * parts must be identical if they contain lowercase characters. >+ * For instance, 'HMap' and 'HaMap' patterns will match 'HashMap' but neither >+ * 'HashMapEntry' nor 'HatMapper'. Note that when the last part does not contain >+ * lowercase characters, then the name may end with lowercase characters. >+ * So, 'HM' pattern will match both 'HashMap' <b>and</b> 'HatMapper' but will not >+ * match 'HashMapEntry'. >+ * <p> >+ * <pre> >+ * Examples: >+ * <ol> >+ * <li> pattern = { 'N', 'P', 'E' } >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * nameStart = 0 >+ * nameEnd = 20 >+ * result => true</li> >+ * <li> pattern = { 'N', 'P', 'E' } >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * nameStart = 0 >+ * nameEnd = 21 >+ * result => true</li> >+ * <li> pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } >+ * patternStart = 0 >+ * patternEnd = 6 >+ * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * nameStart = 0 >+ * nameEnd = 20 >+ * result => true</li> >+ * <li> pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } >+ * patternStart = 0 >+ * patternEnd = 6 >+ * name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * nameStart = 0 >+ * nameEnd = 21 >+ * result => false</li> >+ * <li> pattern = { 'n', p', 'e' } >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } >+ * nameStart = 0 >+ * nameEnd = 20 >+ * result => false</li> >+ * <li> pattern = { 'I', 'P', 'L', '3' } >+ * patternStart = 0 >+ * patternEnd = 4 >+ * name = { 'I', 'P', 'e', 'r', 's', 'p', 'e', 'c', 't', 'i', 'v', 'e', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '3' } >+ * nameStart = 0 >+ * nameEnd = 21 >+ * result => true</li> >+ * <li> pattern = { 'H', M' } >+ * patternStart = 0 >+ * patternEnd = 2 >+ * name = { 'H', 'a', 's', 'h', 'M', 'a', 'p', 'E', 'n', 't', 'r', 'y' } >+ * nameStart = 0 >+ * nameEnd = 12 >+ * result => (exactMode == false)</li> >+ * <li> pattern = { 'H', M', 'a', 'p' } >+ * patternStart = 0 >+ * patternEnd = 4 >+ * name = { 'H', 'a', 't', 'M', 'a', 'p', 'p', 'e', 'r' } >+ * nameStart = 0 >+ * nameEnd = 9 >+ * result => (exactMode == false)</li> >+ * </ol> >+ * </pre> >+ * >+ * @param pattern the given pattern >+ * @param patternStart the start index of the pattern, inclusive >+ * @param patternEnd the end index of the pattern, exclusive >+ * @param name the given name >+ * @param nameStart the start index of the name, inclusive >+ * @param nameEnd the end index of the name, exclusive >+ * @param prefixMatch flag telling whether the pattern can match name prefix or not. >+ * <ul> >+ * <li>For example, when it's <code>true</code>:<br> >+ * - 'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types, >+ * but not 'HashMapEntry'<br> >+ * - 'HMap' type string pattern will match 'HashMap' type but not 'HtmlMapper'. >+ * </li> >+ * <li>and, when it's <code>false</code>:<br> >+ * - 'HM' type string pattern will match both 'HashMap' and 'HtmlMapper' >+ * and 'HashMapEntry'<br> >+ * - 'HMap' type string pattern will match both 'HashMap' and 'HtmlMapper' >+ * types. >+ * </li> >+ * </ul> >+ * @return true if a sub-pattern matches the sub-part of the given name, false otherwise >+ * @since 3.4 >+ */ >+public static final boolean camelCaseMatch(char[] pattern, int patternStart, int patternEnd, char[] name, int nameStart, int nameEnd, boolean prefixMatch) { > if (name == null) > return false; // null name cannot match > if (pattern == null) >@@ -346,9 +606,38 @@ > iPattern++; > iName++; > >- if (iPattern == patternEnd) { >- // We have exhausted pattern, so it's a match >- return true; >+ if (iPattern == patternEnd) { // we have exhausted pattern... >+ // it's a match if not exact mode or name is also exhausted >+ if (prefixMatch || iName == nameEnd) return true; >+ >+ // it's not a match if last pattern character is a lowercase >+ if ((patternChar = pattern[iPattern-1]) < ScannerHelper.MAX_OBVIOUS) { >+ if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[patternChar] & (ScannerHelper.C_UPPER_LETTER | ScannerHelper.C_DIGIT)) == 0) { >+ return false; >+ } >+ } >+ else if (Character.isJavaIdentifierPart(patternChar) && !Character.isUpperCase(patternChar) && !Character.isDigit(patternChar)) { >+ return false; >+ } >+ >+ // it's a match only if name has no more uppercase characters (exact mode) >+ while (true) { >+ if (iName == nameEnd) { >+ // we have exhausted name, so it's a match >+ return true; >+ } >+ nameChar = name[iName]; >+ if (nameChar < ScannerHelper.MAX_OBVIOUS) { >+ if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[nameChar] & ScannerHelper.C_UPPER_LETTER) != 0) { >+ // nameChar is uppercase, so it's not a match >+ return false; >+ } >+ } >+ else if (!Character.isJavaIdentifierPart(nameChar) || Character.isUpperCase(nameChar)) { >+ return false; >+ } >+ iName++; >+ } > } > > if (iName == nameEnd){ >@@ -873,7 +1162,7 @@ > * </ol> > * > * @param prefix the prefix character >- * @param array the array that is concanated with the prefix and suffix characters >+ * @param array the array that is concatenated with the prefix and suffix characters > * @param suffix the suffix character > * @return the new array > */ >@@ -2700,7 +2989,7 @@ > > /** > * Answers a new array removing a given character. Answers the given array if there is >- * no occurence of the character to remove. >+ * no occurrence of the character to remove. > * <br> > * <br> > * For example: >@@ -2749,7 +3038,7 @@ > } > > /** >- * Replace all occurrence of the character to be replaced with the remplacement character in the >+ * Replace all occurrence of the character to be replaced with the replacement character in the > * given array. > * <br> > * <br> >@@ -2789,7 +3078,7 @@ > } > > /** >- * Replace all occurrences of characters to be replaced with the remplacement character in the >+ * Replace all occurrences of characters to be replaced with the replacement character in the > * given array. > * <br> > * <br> >@@ -2815,7 +3104,7 @@ > } > > /** >- * Replace all occurrences of characters to be replaced with the remplacement character in the >+ * Replace all occurrences of characters to be replaced with the replacement character in the > * given array from the start position (inclusive) to the end position (exclusive). > * <br> > * <br> >@@ -2933,7 +3222,7 @@ > } > > /** >- * Replace all occurrence of the character to be replaced with the remplacement character >+ * Replace all occurrence of the character to be replaced with the replacement character > * in a copy of the given array. Returns the given array if no occurrences of the character > * to be replaced are found. > * <br> >@@ -2985,7 +3274,7 @@ > } > > /** >- * Return a new array which is the split of the given array using the given divider and triming each subarray to remove >+ * Return a new array which is the split of the given array using the given divider and trimming each subarray to remove > * whitespaces equals to ' '. > * <br> > * <br> >@@ -3019,7 +3308,7 @@ > * > * @param divider the given divider > * @param array the given array >- * @return a new array which is the split of the given array using the given divider and triming each subarray to remove >+ * @return a new array which is the split of the given array using the given divider and trimming each subarray to remove > * whitespaces equals to ' ' > */ > public static final char[][] splitAndTrimOn(char divider, char[] array) { >Index: search/org/eclipse/jdt/core/search/SearchPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java,v >retrieving revision 1.69 >diff -u -r1.69 SearchPattern.java >--- search/org/eclipse/jdt/core/search/SearchPattern.java 17 Aug 2007 06:14:50 -0000 1.69 >+++ search/org/eclipse/jdt/core/search/SearchPattern.java 24 Aug 2007 05:50:11 -0000 >@@ -32,12 +32,12 @@ > * then created (see {@link #getBlankPattern()}). This blank pattern is used as a record as follows. > * For each index entry in the given index categories and that starts with the given key, the blank pattern is fed using > * {@link #decodeIndexKey(char[])}. The original pattern is then asked if it matches the decoded key using >- * {@link #matchesDecodedKey(SearchPattern)}. If it matches, a search doument is created for this index entry >+ * {@link #matchesDecodedKey(SearchPattern)}. If it matches, a search document is created for this index entry > * using {@link SearchParticipant#getDocument(String)}. > * > * </p><p> >- * This class is intended to be subclassed by clients. A default behavior is provided for each of the methods above, that >- * clients can ovveride if they wish. >+ * This class is intended to be sub-classed by clients. A default behavior is provided for each of the methods above, that >+ * clients can override if they wish. > * </p> > * @see #createPattern(org.eclipse.jdt.core.IJavaElement, int) > * @see #createPattern(String, int, int, int) >@@ -141,34 +141,75 @@ > > /** > * Match rule: The search pattern contains a Camel Case expression. >- * <br> >+ * <p> > * Examples: > * <ul> >- * <li><code>NPE</code> type string pattern will match >- * <code>NullPointerException</code> and <code>NpPermissionException</code> types,</li> >- * <li><code>NuPoEx</code> type string pattern will only match >- * <code>NullPointerException</code> type.</li> >+ * <li>'NPE' type string pattern will match >+ * 'NullPointerException' and 'NoPermissionException' types,</li> >+ * <li>'NuPoEx' type string pattern will only match >+ * 'NullPointerException' type.</li> > * </ul> >- * @see CharOperation#camelCaseMatch(char[], char[]) for a detailed explanation >- * of Camel Case matching. >- *<br> >- * Can be combined to {@link #R_PREFIX_MATCH} match rule. For example, >- * when prefix match rule is combined with Camel Case match rule, >- * <code>"nPE"</code> pattern will match <code>nPException</code>. >- *<br> >+ * >+ * This Camel Case match rule also accepts both prefix and case insensitive >+ * matches. For instance 'HashMap' or 'HASHMAP' pattern using Camel Case rule will match >+ * both 'HashMap' and 'HashMapEntry'. >+ *<p> > * Match rule {@link #R_PATTERN_MATCH} may also be combined but both rules > * will not be used simultaneously as they are mutually exclusive. > * Used match rule depends on whether string pattern contains specific pattern > * characters (e.g. '*' or '?') or not. If it does, then only Pattern match rule > * will be used, otherwise only Camel Case match will be used. >- * For example, with <code>"NPE"</code> string pattern, search will only use >- * Camel Case match rule, but with <code>N*P*E*</code> string pattern, it will >+ * For example, with 'NPE' string pattern, search will only use >+ * Camel Case match rule, but with 'N*P*E*' string pattern, it will > * use only Pattern match rule. >+ * <p> >+ * @see #camelCaseMatch(String, String) for a detailed explanation of Camel >+ * Case matching. > * > * @since 3.2 >+ * @deprecated Use <code>{@link #R_CAMEL_CASE_MATCH} | >+ * {@link #R_PREFIX_MATCH}</code> instead. > */ > public static final int R_CAMELCASE_MATCH = 0x0080; > >+ /** >+ * Match rule: The search pattern contains a Camel Case expression with >+ * a strict number of parts and preventing automatic prefix matching for the last >+ * part (if it consists of multiple letters). >+ * <br> >+ * Examples: >+ * <ul> >+ * <li>'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types, >+ * but not 'HashMapEntry' >+ * </li> >+ * <li>'HMap' type string pattern will match 'HashMap' type but not 'HtmlMapper'. >+ * </li> >+ * </ul> >+ * >+ * This Camel Case match rule does not allow prefix match but accept insensitive >+ * case. For instance, 'HashMap' or 'HASHMAP' patterns using this Camel Case >+ * rule will match both 'HashMap' but not 'HashMapEntry'. >+ * <p> >+ * This rule still can be combined to prefix match to accept prefix matches >+ * ('HashMap' pattern matching 'HashMapEntry' name). It can also be combined >+ * to case sensitive match to reject case insensitive matches ('HAMA' pattern >+ * will not match 'HashMap' name). >+ *<p> >+ * If {@link #R_PATTERN_MATCH} rule is also combined, then the real used >+ * match rule will depend on whether string pattern contains specific pattern >+ * characters (e.g. '*' or '?') or not. If it does, then only Pattern match rule will >+ * be used, otherwise only Camel Case match will be used.<br> >+ * For example, with 'NPE' string pattern, search will only use >+ * Camel Case match rule, but with 'N*P*E*' string pattern, it will >+ * use only Pattern match rule. >+ *<p> >+ * @see CharOperation#camelCaseMatch(char[], char[], boolean) for a detailed >+ * explanation of Camel Case matching. >+ *<p> >+ * @since 3.4 >+ */ >+ public static final int R_CAMEL_CASE_MATCH = 0x0100; >+ > private static final int MODE_MASK = R_EXACT_MATCH | R_PREFIX_MATCH | R_PATTERN_MATCH | R_REGEXP_MATCH; > > private int matchRule; >@@ -178,11 +219,13 @@ > * It can be exact match, prefix match, pattern match or regexp match. > * Rule can also be combined with a case sensitivity flag. > * >- * @param matchRule one of {@link #R_EXACT_MATCH}, {@link #R_PREFIX_MATCH}, {@link #R_PATTERN_MATCH}, >- * {@link #R_REGEXP_MATCH}, {@link #R_CAMELCASE_MATCH} combined with one of following values: >- * {@link #R_CASE_SENSITIVE}, {@link #R_ERASURE_MATCH} or {@link #R_EQUIVALENT_MATCH}. >- * e.g. {@link #R_EXACT_MATCH} | {@link #R_CASE_SENSITIVE} if an exact and case sensitive match is requested, >- * {@link #R_PREFIX_MATCH} if a prefix non case sensitive match is requested or {@link #R_EXACT_MATCH} | {@link #R_ERASURE_MATCH} >+ * @param matchRule one of {@link #R_EXACT_MATCH}, {@link #R_PREFIX_MATCH}, >+ * {@link #R_PATTERN_MATCH}, {@link #R_REGEXP_MATCH} combined with >+ * one of following values: {@link #R_CASE_SENSITIVE}, {@link #R_ERASURE_MATCH}, >+ * {@link #R_EQUIVALENT_MATCH} or {@link #R_CAMEL_CASE_MATCH}. >+ * e.g. {@link #R_EXACT_MATCH} | {@link #R_CASE_SENSITIVE} if an exact >+ * and case sensitive match is requested, {@link #R_PREFIX_MATCH} if a prefix >+ * non case sensitive match is requested or {@link #R_EXACT_MATCH} | {@link #R_ERASURE_MATCH} > * if a non case sensitive and erasure match is requested.<br> > * Note that {@link #R_ERASURE_MATCH} or {@link #R_EQUIVALENT_MATCH} have no effect > * on non-generic types/methods search.<br> >@@ -194,13 +237,61 @@ > if ((matchRule & (R_EQUIVALENT_MATCH | R_ERASURE_MATCH )) == 0) { > this.matchRule |= R_FULL_MATCH; > } >+ this.matchRule = updateMatchRule(this.matchRule); > } > > /** >- * Answers true if the pattern matches the given name using CamelCase rules, or false otherwise. >- * CamelCase matching does NOT accept explicit wild-cards '*' and '?' and is inherently case sensitive. >+ * Answers true if the pattern matches the given name using CamelCase rules, or >+ * false otherwise. char[] CamelCase matching does NOT accept explicit wild-cards >+ * '*' and '?' and is inherently case sensitive. >+ * <p> >+ * CamelCase denotes the convention of writing compound names without spaces, >+ * and capitalizing every term. This function recognizes both upper and lower >+ * CamelCase, depending whether the leading character is capitalized or not. >+ * The leading part of an upper CamelCase pattern is assumed to contain a >+ * sequence of capitals which are appearing in the matching name; e.g. 'NPE' will >+ * match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern >+ * uses a lowercase first character. In Java, type names follow the upper >+ * CamelCase convention, whereas method or field names follow the lower >+ * CamelCase convention. >+ * <p> >+ * The pattern may contain lowercase characters, which will be matched in a case >+ * sensitive way. These characters must appear in sequence in the name. >+ * For instance, 'NPExcep' will match 'NullPointerException', but not >+ * 'NullPointerExCEPTION' or 'NuPoEx' will match 'NullPointerException', but not >+ * 'NoPointerException'. >+ * <p> >+ * Digit characters are treated in a special way. They can be used in the pattern >+ * but are not always considered as leading character. For instance, both >+ * 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'. >+ * <p> >+ * This method allows prefix match in Camel Case (see >+ * {@link #camelCaseMatch(String, String, boolean)}). >+ * <p> >+ * <pre> >+ * Examples: >+ * <ol><li> pattern = "NPE" >+ * name = NullPointerException / NoPermissionException >+ * result => true</li> >+ * <li> pattern = "NuPoEx" >+ * name = NullPointerException >+ * result => true</li> >+ * <li> pattern = "npe" >+ * name = NullPointerException >+ * result => false</li> >+ * <li> pattern = "IPL3" >+ * name = "IPerspectiveListener3" >+ * result => true</li> >+ * <li> pattern = "HM" >+ * name = "HashMapEntry" >+ * result => true</li> >+ * <li> pattern = "HMap" >+ * name = "HatMapper" >+ * result => true</li> >+ * </ol></pre> > * >- * @see CharOperation#camelCaseMatch(char[], char[]) >+ * @see #camelCaseMatch(String, int, int, String, int, int, boolean) for algorithm >+ * implementation > * > * @param pattern the given pattern > * @param name the given name >@@ -213,17 +304,196 @@ > if (name == null) > return false; // null name cannot match > >- return CharOperation.camelCaseMatch(pattern.toCharArray(), 0, pattern.length(), name.toCharArray(), 0, name.length()); >+ return camelCaseMatch(pattern, 0, pattern.length(), name, 0, name.length(), true/*prefix match*/); > } > > /** >- * Answers true if a sub-pattern matches the subpart of the given name using CamelCase rules, or false otherwise. >- * char[] CamelCase matching does NOT accept explicit wild-cards '*' and '?' and is inherently case sensitive. >- * Can match only subset of name/pattern, considering end positions as non-inclusive. >- * The subpattern is defined by the patternStart and patternEnd positions. >+ * Answers true if the pattern matches the given name using CamelCase rules, or >+ * false otherwise. char[] CamelCase matching does NOT accept explicit wild-cards >+ * '*' and '?' and is inherently case sensitive. >+ * <p> >+ * CamelCase denotes the convention of writing compound names without spaces, >+ * and capitalizing every term. This function recognizes both upper and lower >+ * CamelCase, depending whether the leading character is capitalized or not. >+ * The leading part of an upper CamelCase pattern is assumed to contain a >+ * sequence of capitals which are appearing in the matching name; e.g. 'NPE' will >+ * match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern >+ * uses a lowercase first character. In Java, type names follow the upper >+ * CamelCase convention, whereas method or field names follow the lower >+ * CamelCase convention. >+ * <p> >+ * The pattern may contain lowercase characters, which will be matched in a case >+ * sensitive way. These characters must appear in sequence in the name. >+ * For instance, 'NPExcep' will match 'NullPointerException', but not >+ * 'NullPointerExCEPTION' or 'NuPoEx' will match 'NullPointerException', but not >+ * 'NoPointerException'. >+ * <p> >+ * Digit characters are treated in a special way. They can be used in the pattern >+ * but are not always considered as leading character. For instance, both >+ * 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'. >+ * <p> >+ * CamelCase may or may not match prefixes depending on the given parameter. >+ * When the prefix match parameter is <code>true</code>, the given pattern can >+ * match only a prefix of the given name. For instance, 'HM' , 'HaMa' and 'HMap' >+ * patterns will all match 'HashMap', 'HatMapper' <b>and</b> 'HashMapEntry'. >+ * <br> >+ * Reversely, if the prefix match parameter is <code>false</code>, then pattern >+ * and name must have <b>exactly</b> the same number of parts, and their last >+ * parts must be identical if they contain lowercase characters. >+ * For instance, 'HMap' and 'HaMap' patterns will match 'HashMap' but neither >+ * 'HashMapEntry' nor 'HatMapper'. Note that when the last part does not contain >+ * lowercase characters, then the name may end with lowercase characters. >+ * So, 'HM' pattern will match both 'HashMap' <b>and</b> 'HatMapper' but will not >+ * match 'HashMapEntry'. >+ * <p> >+ * <pre> >+ * Examples: >+ * <ol><li> pattern = "NPE" >+ * name = NullPointerException / NoPermissionException >+ * result => true</li> >+ * <li> pattern = "NuPoEx" >+ * name = NullPointerException >+ * result => true</li> >+ * <li> pattern = "npe" >+ * name = NullPointerException >+ * result => false</li> >+ * <li> pattern = "IPL3" >+ * name = "IPerspectiveListener3" >+ * result => true</li> >+ * <li> pattern = "HM" >+ * name = "HashMapEntry" >+ * result => (prefixMatch == true)</li> >+ * <li> pattern = "HMap" >+ * name = "HatMapper" >+ * result => (prefixMatch == true)</li> >+ * </ol></pre> > * >- * @see CharOperation#camelCaseMatch(char[], int, int, char[], int, int) for specification >- * and implementation of this algorithm. >+ * @see #camelCaseMatch(String, int, int, String, int, int, boolean) for algorithm >+ * implementation >+ * >+ * @param pattern the given pattern >+ * @param name the given name >+ * @param prefixMatch flag telling whether the pattern can match name prefix or not. >+ * <ul> >+ * <li>For example, when it's <code>true</code>:<br> >+ * - <code>HM</code> type string pattern will match >+ * <code>HashMap</code> and <code>HtmlMapper</code> types, >+ * but not <code>HashMapEntry</code><br> >+ * - <code>HMap</code> type string pattern will match >+ * <code>HashMap</code> type but not <code>HtmlMapper</code>. >+ * </li> >+ * <li>and, when it's <code>false</code>:<br> >+ * - <code>HM</code> type string pattern will match both >+ * <code>HashMap</code> and <code>HtmlMapper</code> >+ * and <code>HashMapEntry</code><br> >+ * - <code>HMap</code> type string pattern will match both >+ * <code>HashMap</code> and <code>HtmlMapper</code> types. >+ * </li> >+ * </ul> >+ * @return true if the pattern matches the given name, false otherwise >+ * @since 3.4 >+ */ >+public static final boolean camelCaseMatch(String pattern, String name, boolean prefixMatch) { >+ if (pattern == null) >+ return true; // null pattern is equivalent to '*' >+ if (name == null) >+ return false; // null name cannot match >+ >+ return camelCaseMatch(pattern, 0, pattern.length(), name, 0, name.length(), prefixMatch); >+} >+ >+/** >+ * Answers true if a sub-pattern matches the sub-part of the given name using >+ * CamelCase rules, or false otherwise. char[] CamelCase matching does NOT >+ * accept explicit wild-cards '*' and '?' and is inherently case sensitive. >+ * Can match only subset of name/pattern, considering end positions as non-inclusive. >+ * The sub-pattern is defined by the patternStart and patternEnd positions. >+ * <p> >+ * CamelCase denotes the convention of writing compound names without spaces, >+ * and capitalizing every term. This function recognizes both upper and lower >+ * CamelCase, depending whether the leading character is capitalized or not. >+ * The leading part of an upper CamelCase pattern is assumed to contain a >+ * sequence of capitals which are appearing in the matching name; e.g. 'NPE' will >+ * match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern >+ * uses a lowercase first character. In Java, type names follow the upper >+ * CamelCase convention, whereas method or field names follow the lower >+ * CamelCase convention. >+ * <p> >+ * The pattern may contain lowercase characters, which will be matched in a case >+ * sensitive way. These characters must appear in sequence in the name. >+ * For instance, 'NPExcep' will match 'NullPointerException', but not >+ * 'NullPointerExCEPTION' or 'NuPoEx' will match 'NullPointerException', but not >+ * 'NoPointerException'. >+ * <p> >+ * Digit characters are treated in a special way. They can be used in the pattern >+ * but are not always considered as leading character. For instance, both >+ * 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'. >+ * <p> >+ * Digit characters are treated in a special way. They can be used in the pattern >+ * but are not always considered as leading character. For instance, both >+ * 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'. >+ * <p> >+ * This method allows prefix match in Camel Case (see >+ * {@link #camelCaseMatch(String, int, int, String, int, int, boolean)}). >+ * <p> >+ * <pre>Examples:<ol> >+ * <li> pattern = "NPE" >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = NullPointerException >+ * nameStart = 0 >+ * nameEnd = 20 >+ * result => true</li> >+ * <li> pattern = "NPE" >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = NoPermissionException >+ * nameStart = 0 >+ * nameEnd = 21 >+ * result => true</li> >+ * <li> pattern = "NuPoEx" >+ * patternStart = 0 >+ * patternEnd = 6 >+ * name = NullPointerException >+ * nameStart = 0 >+ * nameEnd = 20 >+ * result => true</li> >+ * <li> pattern = "NuPoEx" >+ * patternStart = 0 >+ * patternEnd = 6 >+ * name = NoPermissionException >+ * nameStart = 0 >+ * nameEnd = 21 >+ * result => false</li> >+ * <li> pattern = "npe" >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = NullPointerException >+ * nameStart = 0 >+ * nameEnd = 20 >+ * result => false</li> >+ * <li> pattern = "IPL3" >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = "IPerspectiveListener3" >+ * nameStart = 0 >+ * nameEnd = 21 >+ * result => true</li> >+ * <li> pattern = "HM" >+ * patternStart = 0 >+ * patternEnd = 2 >+ * name = "HashMapEntry" >+ * nameStart = 0 >+ * nameEnd = 12 >+ * result => true</li> >+ * <li> pattern = "HMap" >+ * patternStart = 0 >+ * patternEnd = 4 >+ * name = "HatMapper" >+ * nameStart = 0 >+ * nameEnd = 9 >+ * result => true</li> >+ * </ol></pre> > * > * @param pattern the given pattern > * @param patternStart the start index of the pattern, inclusive >@@ -231,11 +501,274 @@ > * @param name the given name > * @param nameStart the start index of the name, inclusive > * @param nameEnd the end index of the name, exclusive >- * @return true if a sub-pattern matches the subpart of the given name, false otherwise >+ * @return true if a sub-pattern matches the sub-part of the given name, false otherwise > * @since 3.2 > */ > public static final boolean camelCaseMatch(String pattern, int patternStart, int patternEnd, String name, int nameStart, int nameEnd) { >- return CharOperation.camelCaseMatch(pattern.toCharArray(), patternStart, patternEnd, name.toCharArray(), nameStart, nameEnd); >+ return camelCaseMatch(pattern, patternStart, patternEnd, name, nameStart, nameEnd, true/*prefix match*/); >+} >+ >+/** >+ * Answers true if a sub-pattern matches the sub-part of the given name using >+ * CamelCase rules, or false otherwise. char[] CamelCase matching does NOT >+ * accept explicit wild-cards '*' and '?' and is inherently case sensitive. >+ * Can match only subset of name/pattern, considering end positions as >+ * non-inclusive. The sub-pattern is defined by the patternStart and patternEnd >+ * positions. >+ * <p> >+ * CamelCase denotes the convention of writing compound names without spaces, >+ * and capitalizing every term. This function recognizes both upper and lower >+ * CamelCase, depending whether the leading character is capitalized or not. >+ * The leading part of an upper CamelCase pattern is assumed to contain >+ * a sequence of capitals which are appearing in the matching name; e.g. 'NPE' will >+ * match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern >+ * uses a lowercase first character. In Java, type names follow the upper >+ * CamelCase convention, whereas method or field names follow the lower >+ * CamelCase convention. >+ * <p> >+ * The pattern may contain lowercase characters, which will be matched in a case >+ * sensitive way. These characters must appear in sequence in the name. >+ * For instance, 'NPExcep' will match 'NullPointerException', but not >+ * 'NullPointerExCEPTION' or 'NuPoEx' will match 'NullPointerException', but not >+ * 'NoPointerException'. >+ * <p> >+ * Digit characters are treated in a special way. They can be used in the pattern >+ * but are not always considered as leading character. For instance, both >+ * 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'. >+ * <p> >+ * CamelCase may or may not match prefixes depending on the given parameter. >+ * When the prefix match parameter is <code>true</code>, the given pattern can >+ * match only a prefix of the given name. For instance, 'HM' , 'HaMa' and 'HMap' >+ * patterns will all match 'HashMap', 'HatMapper' <b>and</b> 'HashMapEntry'. >+ * <br> >+ * Reversely, if the prefix match parameter is <code>false</code>, then pattern >+ * and name must have <b>exactly</b> the same number of parts, and their last >+ * parts must be identical if they contain lowercase characters. >+ * For instance, 'HMap' and 'HaMap' patterns will match 'HashMap' but neither >+ * 'HashMapEntry' nor 'HatMapper'. Note that when the last part does not contain >+ * lowercase characters, then the name may end with lowercase characters. >+ * So, 'HM' pattern will match both 'HashMap' <b>and</b> 'HatMapper' but will not >+ * match 'HashMapEntry'. >+ * <p> >+ * <pre>Examples:<ol> >+ * <li> pattern = "NPE" >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = NullPointerException >+ * nameStart = 0 >+ * nameEnd = 20 >+ * result => true</li> >+ * <li> pattern = "NPE" >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = NoPermissionException >+ * nameStart = 0 >+ * nameEnd = 21 >+ * result => true</li> >+ * <li> pattern = "NuPoEx" >+ * patternStart = 0 >+ * patternEnd = 6 >+ * name = NullPointerException >+ * nameStart = 0 >+ * nameEnd = 20 >+ * result => true</li> >+ * <li> pattern = "NuPoEx" >+ * patternStart = 0 >+ * patternEnd = 6 >+ * name = NoPermissionException >+ * nameStart = 0 >+ * nameEnd = 21 >+ * result => false</li> >+ * <li> pattern = "npe" >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = NullPointerException >+ * nameStart = 0 >+ * nameEnd = 20 >+ * result => false</li> >+ * <li> pattern = "IPL3" >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = "IPerspectiveListener3" >+ * nameStart = 0 >+ * nameEnd = 21 >+ * result => true</li> >+ * <li> pattern = "HM" >+ * patternStart = 0 >+ * patternEnd = 2 >+ * name = "HashMapEntry" >+ * nameStart = 0 >+ * nameEnd = 12 >+ * result => (prefixMatch == true)</li> >+ * <li> pattern = "HMap" >+ * patternStart = 0 >+ * patternEnd = 4 >+ * name = "HatMapper" >+ * nameStart = 0 >+ * nameEnd = 9 >+ * result => (prefixMatch == true)</li> >+ * </ol></pre> >+ * >+ * @see CharOperation#camelCaseMatch(char[], int, int, char[], int, int, boolean) >+ * from which algorithm implementation has been entirely copied. >+ * >+ * @param pattern the given pattern >+ * @param patternStart the start index of the pattern, inclusive >+ * @param patternEnd the end index of the pattern, exclusive >+ * @param name the given name >+ * @param nameStart the start index of the name, inclusive >+ * @param nameEnd the end index of the name, exclusive >+ * @param prefixMatch flag telling whether the pattern can match name prefix or not. >+ * <ul> >+ * <li>For example, when it's <code>true</code>:<br> >+ * - <code>HM</code> type string pattern will match >+ * <code>HashMap</code> and <code>HtmlMapper</code> types, >+ * but not <code>HashMapEntry</code><br> >+ * - <code>HMap</code> type string pattern will match >+ * <code>HashMap</code> type but not <code>HtmlMapper</code>. >+ * </li> >+ * <li>and, when it's <code>false</code>:<br> >+ * - <code>HM</code> type string pattern will match both >+ * <code>HashMap</code> and <code>HtmlMapper</code> >+ * and <code>HashMapEntry</code><br> >+ * - <code>HMap</code> type string pattern will match both >+ * <code>HashMap</code> and <code>HtmlMapper</code> types. >+ * </li> >+ * </ul> >+ * @return true if a sub-pattern matches the sub-part of the given name, false otherwise >+ * @since 3.4 >+ */ >+public static final boolean camelCaseMatch(String pattern, int patternStart, int patternEnd, String name, int nameStart, int nameEnd, boolean prefixMatch) { >+ >+ /* >+ * The algorithm of this method has been entirely copied from >+ * CharOperation#camelCaseMatch(char[], int, int, char[], int, int, boolean) >+ * Array lengths have been replaced with call to {@link String#length()} and >+ * array direct access have been replaced with call to {@link String#charAt(int)}. >+ * WARNING: Do not change one of these methods without changing the other >+ * the same way otherwise behavior differences may appear while using them... >+ */ >+ >+ if (name == null) >+ return false; // null name cannot match >+ if (pattern == null) >+ return true; // null pattern is equivalent to '*' >+ if (patternEnd < 0) patternEnd = pattern.length(); >+ if (nameEnd < 0) nameEnd = name.length(); >+ >+ if (patternEnd <= patternStart) return nameEnd <= nameStart; >+ if (nameEnd <= nameStart) return false; >+ // check first pattern char >+ if (name.charAt(nameStart) != pattern.charAt(patternStart)) { >+ // first char must strictly match (upper/lower) >+ return false; >+ } >+ >+ char patternChar, nameChar; >+ int iPattern = patternStart; >+ int iName = nameStart; >+ >+ // Main loop is on pattern characters >+ while (true) { >+ >+ iPattern++; >+ iName++; >+ >+ if (iPattern == patternEnd) { // we have exhausted pattern... >+ // it's a match if not exact mode or name is also exhausted >+ if (prefixMatch || iName == nameEnd) return true; >+ >+ // it's not a match if last pattern character is a lowercase >+ if ((patternChar = pattern.charAt(iPattern-1)) < ScannerHelper.MAX_OBVIOUS) { >+ if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[patternChar] & (ScannerHelper.C_UPPER_LETTER | ScannerHelper.C_DIGIT)) == 0) { >+ return false; >+ } >+ } >+ else if (Character.isJavaIdentifierPart(patternChar) && !Character.isUpperCase(patternChar) && !Character.isDigit(patternChar)) { >+ return false; >+ } >+ >+ // it's a match only if name has no more uppercase characters (exact mode) >+ while (true) { >+ if (iName == nameEnd) { >+ // we have exhausted name, so it's a match >+ return true; >+ } >+ nameChar = name.charAt(iName); >+ if (nameChar < ScannerHelper.MAX_OBVIOUS) { >+ if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[nameChar] & ScannerHelper.C_UPPER_LETTER) != 0) { >+ // nameChar is uppercase, so it's not a match >+ return false; >+ } >+ } >+ else if (!Character.isJavaIdentifierPart(nameChar) || Character.isUpperCase(nameChar)) { >+ return false; >+ } >+ iName++; >+ } >+ } >+ >+ if (iName == nameEnd){ >+ // We have exhausted name (and not pattern), so it's not a match >+ return false; >+ } >+ >+ // For as long as we're exactly matching, bring it on (even if it's a lower case character) >+ if ((patternChar = pattern.charAt(iPattern)) == name.charAt(iName)) { >+ continue; >+ } >+ >+ // If characters are not equals, then it's not a match if patternChar is lowercase >+ if (patternChar < ScannerHelper.MAX_OBVIOUS) { >+ if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[patternChar] & (ScannerHelper.C_UPPER_LETTER | ScannerHelper.C_DIGIT)) == 0) { >+ return false; >+ } >+ } >+ else if (Character.isJavaIdentifierPart(patternChar) && !Character.isUpperCase(patternChar) && !Character.isDigit(patternChar)) { >+ return false; >+ } >+ >+ // patternChar is uppercase, so let's find the next uppercase in name >+ while (true) { >+ if (iName == nameEnd){ >+ // We have exhausted name (and not pattern), so it's not a match >+ return false; >+ } >+ >+ nameChar = name.charAt(iName); >+ if (nameChar < ScannerHelper.MAX_OBVIOUS) { >+ int charNature = ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[nameChar]; >+ if ((charNature & (ScannerHelper.C_LOWER_LETTER | ScannerHelper.C_SPECIAL)) != 0) { >+ // nameChar is lowercase >+ iName++; >+ } else if ((charNature & ScannerHelper.C_DIGIT) != 0) { >+ // nameChar is digit => break if the digit is current pattern character otherwise consume it >+ if (patternChar == nameChar) break; >+ iName++; >+ // nameChar is uppercase... >+ } else if (patternChar != nameChar) { >+ //.. and it does not match patternChar, so it's not a match >+ return false; >+ } else { >+ //.. and it matched patternChar. Back to the big loop >+ break; >+ } >+ } >+ // Same tests for non-obvious characters >+ else if (Character.isJavaIdentifierPart(nameChar) && !Character.isUpperCase(nameChar)) { >+ iName++; >+ } else if (Character.isDigit(nameChar)) { >+ if (patternChar == nameChar) break; >+ iName++; >+ } else if (patternChar != nameChar) { >+ return false; >+ } else { >+ break; >+ } >+ } >+ // At this point, either name has been exhausted, or it is at an uppercase letter. >+ // Since pattern is also at an uppercase letter >+ } > } > > /** >@@ -850,7 +1383,7 @@ > * <li>{@link IJavaSearchConstants#ANNOTATION_TYPE}: only look for annotation type</li> > * <li>{@link IJavaSearchConstants#CLASS_AND_ENUM}: only look for classes and enumerations</li> > * <li>{@link IJavaSearchConstants#CLASS_AND_INTERFACE}: only look for classes and interfaces</li> >- * <li>{@link IJavaSearchConstants#TYPE}: look for all types (ie. classes, interfaces, enum and annotation types)</li> >+ * <li>{@link IJavaSearchConstants#TYPE}: look for all types (i.e. classes, interfaces, enum and annotation types)</li> > * <li>{@link IJavaSearchConstants#FIELD}: look for fields</li> > * <li>{@link IJavaSearchConstants#METHOD}: look for methods</li> > * <li>{@link IJavaSearchConstants#CONSTRUCTOR}: look for constructors</li> >@@ -860,7 +1393,7 @@ > * <ul> > * <li>{@link IJavaSearchConstants#DECLARATIONS}: will search declarations matching > * with the corresponding element. In case the element is a method, declarations of matching >- * methods in subtypes will also be found, allowing to find declarations of abstract methods, etc.<br> >+ * methods in sub-types will also be found, allowing to find declarations of abstract methods, etc.<br> > * Note that additional flags {@link IJavaSearchConstants#IGNORE_DECLARING_TYPE} and > * {@link IJavaSearchConstants#IGNORE_RETURN_TYPE} are ignored for string patterns. > * This is due to the fact that client may omit to define them in string pattern to have same behavior. >@@ -875,11 +1408,13 @@ > * {@link IJavaSearchConstants#INTERFACE} is respectively used instead of {@link IJavaSearchConstants#TYPE}. > * </li> > * </ul> >- * @param matchRule one of {@link #R_EXACT_MATCH}, {@link #R_PREFIX_MATCH}, {@link #R_PATTERN_MATCH}, >- * {@link #R_REGEXP_MATCH}, {@link #R_CAMELCASE_MATCH} combined with one of following values: >- * {@link #R_CASE_SENSITIVE}, {@link #R_ERASURE_MATCH} or {@link #R_EQUIVALENT_MATCH}. >- * e.g. {@link #R_EXACT_MATCH} | {@link #R_CASE_SENSITIVE} if an exact and case sensitive match is requested, >- * {@link #R_PREFIX_MATCH} if a prefix non case sensitive match is requested or {@link #R_EXACT_MATCH} | {@link #R_ERASURE_MATCH} >+ * @param matchRule one of {@link #R_EXACT_MATCH}, {@link #R_PREFIX_MATCH}, >+ * {@link #R_PATTERN_MATCH}, {@link #R_REGEXP_MATCH} combined with >+ * one of following values: {@link #R_CASE_SENSITIVE}, {@link #R_ERASURE_MATCH}, >+ * {@link #R_EQUIVALENT_MATCH} or {@link #R_CAMEL_CASE_MATCH}. >+ * e.g. {@link #R_EXACT_MATCH} | {@link #R_CASE_SENSITIVE} if an exact >+ * and case sensitive match is requested, {@link #R_PREFIX_MATCH} if a prefix >+ * non case sensitive match is requested or {@link #R_EXACT_MATCH} | {@link #R_ERASURE_MATCH} > * if a non case sensitive and erasure match is requested.<br> > * Note that {@link #R_ERASURE_MATCH} or {@link #R_EQUIVALENT_MATCH} have no effect > * on non-generic types/methods search.<br> >@@ -930,7 +1465,7 @@ > * The pattern is used to trigger the appropriate search. > * <br> > * Note that for generic searches, the returned pattern consider {@link #R_ERASURE_MATCH} matches. >- * If other kind of generic matches (ie. {@link #R_EXACT_MATCH} or {@link #R_EQUIVALENT_MATCH}) >+ * If other kind of generic matches (i.e. {@link #R_EXACT_MATCH} or {@link #R_EQUIVALENT_MATCH}) > * are expected, {@link #createPattern(IJavaElement, int, int)} method need to be used instead with > * the explicit match rule specified. > * <br> >@@ -941,7 +1476,7 @@ > * <ul> > * <li>{@link IJavaSearchConstants#DECLARATIONS}: will search declarations matching > * with the corresponding element. In case the element is a method, declarations of matching >- * methods in subtypes will also be found, allowing to find declarations of abstract methods, etc. >+ * methods in sub-types will also be found, allowing to find declarations of abstract methods, etc. > * Some additional flags may be specified while searching declaration: > * <ul> > * <li>{@link IJavaSearchConstants#IGNORE_DECLARING_TYPE}: declaring type will be ignored >@@ -988,7 +1523,7 @@ > * <ul> > * <li>{@link IJavaSearchConstants#DECLARATIONS}: will search declarations matching > * with the corresponding element. In case the element is a method, declarations of matching >- * methods in subtypes will also be found, allowing to find declarations of abstract methods, etc. >+ * methods in sub-types will also be found, allowing to find declarations of abstract methods, etc. > * Some additional flags may be specified while searching declaration: > * <ul> > * <li>{@link IJavaSearchConstants#IGNORE_DECLARING_TYPE}: declaring type will be ignored >@@ -1020,15 +1555,17 @@ > * which directly implement/extend a given interface. > * </li> > * </ul> >- * @param matchRule one of {@link #R_EXACT_MATCH}, {@link #R_PREFIX_MATCH}, {@link #R_PATTERN_MATCH}, >- * {@link #R_REGEXP_MATCH}, {@link #R_CAMELCASE_MATCH} combined with one of following values: >- * {@link #R_CASE_SENSITIVE}, {@link #R_ERASURE_MATCH} or {@link #R_EQUIVALENT_MATCH}. >- * e.g. {@link #R_EXACT_MATCH} | {@link #R_CASE_SENSITIVE} if an exact and case sensitive match is requested, >- * {@link #R_PREFIX_MATCH} if a prefix non case sensitive match is requested or {@link #R_EXACT_MATCH} |{@link #R_ERASURE_MATCH} >+ * @param matchRule one of {@link #R_EXACT_MATCH}, {@link #R_PREFIX_MATCH}, >+ * {@link #R_PATTERN_MATCH}, {@link #R_REGEXP_MATCH} combined with >+ * one of following values: {@link #R_CASE_SENSITIVE}, {@link #R_ERASURE_MATCH}, >+ * {@link #R_EQUIVALENT_MATCH} or {@link #R_CAMEL_CASE_MATCH}. >+ * e.g. {@link #R_EXACT_MATCH} | {@link #R_CASE_SENSITIVE} if an exact >+ * and case sensitive match is requested, {@link #R_PREFIX_MATCH} if a prefix >+ * non case sensitive match is requested or {@link #R_EXACT_MATCH} | {@link #R_ERASURE_MATCH} > * if a non case sensitive and erasure match is requested.<br> >- * Note that {@link #R_ERASURE_MATCH} or {@link #R_EQUIVALENT_MATCH} have no effect on non-generic types >- * or methods search.<br> >- * Note also that default behavior for generic types or methods is to find exact matches. >+ * Note that {@link #R_ERASURE_MATCH} or {@link #R_EQUIVALENT_MATCH} have no effect >+ * on non-generic types/methods search.<br> >+ * Note also that default behavior for generic types/methods search is to find exact matches. > * @return a search pattern for a Java element or <code>null</code> if the given element is ill-formed > * @since 3.1 > */ >@@ -1380,7 +1917,7 @@ > * and look as follow: '<' { [ '?' {'extends'|'super'} ] type ( ',' [ '?' {'extends'|'super'} ] type )* | '?' } '>' > * Please note that: > * - '*' is not valid inside type arguments definition <> >- * - '?' is treated as a wildcard when it is inside <> (ie. it must be put on first position of the type argument) >+ * - '?' is treated as a wildcard when it is inside <> (i.e. it must be put on first position of the type argument) > */ > private static SearchPattern createTypePattern(String patternString, int limitTo, int matchRule, char indexSuffix) { > >@@ -1601,26 +2138,26 @@ > if (pattern == null) return true; // null is as if it was "*" > if (name != null) { > boolean isCaseSensitive = (this.matchRule & R_CASE_SENSITIVE) != 0; >- boolean isCamelCase = (this.matchRule & R_CAMELCASE_MATCH) != 0; >+ boolean isCamelCase = (this.matchRule & R_CAMEL_CASE_MATCH) != 0; > int matchMode = this.matchRule & MODE_MASK; > boolean emptyPattern = pattern.length == 0; >- if (matchMode == R_PREFIX_MATCH && emptyPattern) return true; >+ boolean isPrefix = (this.matchRule & R_PREFIX_MATCH) != 0; >+ if (isPrefix && emptyPattern) return true; > boolean sameLength = pattern.length == name.length; > boolean canBePrefix = name.length >= pattern.length; > boolean matchFirstChar = !isCaseSensitive || emptyPattern || (name.length > 0 && pattern[0] == name[0]); >- if (isCamelCase && matchFirstChar && CharOperation.camelCaseMatch(pattern, name)) { >- return true; >+ if (isCamelCase) { >+ if (matchFirstChar && CharOperation.camelCaseMatch(pattern, name, isPrefix)) { >+ return true; >+ } >+ if (isCaseSensitive) return false; > } > switch (matchMode) { > case R_EXACT_MATCH : >- case R_FULL_MATCH : >- if (!isCamelCase) { >- if (sameLength && matchFirstChar) { >- return CharOperation.equals(pattern, name, isCaseSensitive); >- } >- break; >+ if (sameLength && matchFirstChar) { >+ return CharOperation.equals(pattern, name, isCaseSensitive); > } >- // fall through next case to match as prefix if camel case failed >+ break; > case R_PREFIX_MATCH : > if (canBePrefix && matchFirstChar) { > return CharOperation.prefixEquals(pattern, name, isCaseSensitive); >@@ -1628,6 +2165,7 @@ > break; > > case R_PATTERN_MATCH : >+ // TODO_PERFS (frederic) not sure this lowercase was necessary... > if (!isCaseSensitive) > pattern = CharOperation.toLowerCase(pattern); > return CharOperation.match(pattern, name, isCaseSensitive); >@@ -1643,28 +2181,32 @@ > /** > * Validate compatibility between given string pattern and match rule. > *<br> >- * Optimized (ie. returned match rule is modified) combinations are: >+ * Returned match rule is modified, when following combinations are observed in the given parameters: > * <ul> >- * <li>{@link #R_PATTERN_MATCH} without any '*' or '?' in string pattern: >- * pattern match bit is unset, >+ * <li>{@link #R_PATTERN_MATCH} without any '*' or '?' in string pattern:<br> >+ * => <b>pattern match flag is reset</b>, > * </li> >- * <li>{@link #R_PATTERN_MATCH} and {@link #R_PREFIX_MATCH} bits simultaneously set: >- * prefix match bit is unset, >+ * <li>{@link #R_PATTERN_MATCH} and {@link #R_PREFIX_MATCH} flags >+ * simultaneously set:<br> >+ * => <b>prefix match flag is reset</b>, > * </li> >- * <li>{@link #R_PATTERN_MATCH} and {@link #R_CAMELCASE_MATCH} bits simultaneously set: >- * camel case match bit is unset, >+ * <li>{@link #R_PATTERN_MATCH} and {@link #R_CAMEL_CASE_MATCH} >+ * (or <i>deprecated {@link #R_CAMELCASE_MATCH}</i>) flags simultaneously set:<br> >+ * => <b>camel case match flag is reset</b>, > * </li> >- * <li>{@link #R_CAMELCASE_MATCH} with invalid combination of uppercase and lowercase characters: >- * camel case match bit is unset and replaced with prefix match pattern, >+ * <li>{@link #R_CAMEL_CASE_MATCH} (or <i>deprecated {@link #R_CAMELCASE_MATCH}</i>) >+ * with invalid combination of uppercase and lowercase characters:<br> >+ * => <b>camel case match flag is reset and replaced with prefix match pattern</b>,<br> > * </li> >- * <li>{@link #R_CAMELCASE_MATCH} combined with {@link #R_PREFIX_MATCH} and {@link #R_CASE_SENSITIVE} >- * bits is reduced to only {@link #R_CAMELCASE_MATCH} as Camel Case search is already prefix and case sensitive, >+ * <li>The <i>deprecated {@link #R_CAMELCASE_MATCH}</i> flag combined with >+ * {@link #R_PREFIX_MATCH} and {@link #R_CASE_SENSITIVE} flags is >+ * reduced to <i>deprecated {@link #R_CAMELCASE_MATCH}</i> flag only, > * </li> > * </ul> > *<br> >- * Rejected (ie. returned match rule -1) combinations are: >+ * Rejected (i.e. returned match rule -1) combinations are: > * <ul> >- * <li>{@link #R_REGEXP_MATCH} with any other match mode bit set, >+ * <li>{@link #R_REGEXP_MATCH} with any other match mode flag set, > * </li> > * </ul> > * >@@ -1677,7 +2219,8 @@ > > // Verify Regexp match rule > if ((matchRule & R_REGEXP_MATCH) != 0) { >- if ((matchRule & R_PATTERN_MATCH) != 0 || (matchRule & R_PREFIX_MATCH) != 0 || (matchRule & R_CAMELCASE_MATCH) != 0) { >+ if ((matchRule & R_PATTERN_MATCH) != 0 || (matchRule & R_PREFIX_MATCH) != 0 || >+ (matchRule & R_CAMEL_CASE_MATCH) != 0 || (matchRule & R_CAMELCASE_MATCH) != 0) { > return -1; > } > } >@@ -1686,20 +2229,22 @@ > int starIndex = stringPattern.indexOf('*'); > int questionIndex = stringPattern.indexOf('?'); > if (starIndex < 0 && questionIndex < 0) { >- // reset pattern match bit if any >+ // reset pattern match flag if any > matchRule &= ~R_PATTERN_MATCH; > } else { > // force Pattern rule > matchRule |= R_PATTERN_MATCH; > } > if ((matchRule & R_PATTERN_MATCH) != 0) { >- // remove Camel Case and Prefix match bits if any >+ // remove Camel Case and Prefix match flags if any > matchRule &= ~R_CAMELCASE_MATCH; >+ matchRule &= ~R_CAMEL_CASE_MATCH; > matchRule &= ~R_PREFIX_MATCH; > } > > // Verify Camel Case match rule >- if ((matchRule & R_CAMELCASE_MATCH) != 0) { >+ if ((matchRule & R_CAMEL_CASE_MATCH) != 0) { >+ matchRule &= ~R_CAMELCASE_MATCH; // in case of some user specify both constants > // Verify sting pattern validity > int length = stringPattern.length(); > boolean validCamelCase = true; >@@ -1712,7 +2257,28 @@ > if (!uppercase) uppercase = ScannerHelper.isUpperCase(ch); > } > validCamelCase = validCamelCase && uppercase; >- // Verify bits compatibility >+ // Verify flags compatibility >+ if (!validCamelCase) { >+ matchRule &= ~R_CAMEL_CASE_MATCH; >+ matchRule |= R_PREFIX_MATCH; >+ } >+ } >+ >+ // Verify deprecated Camel Case match rule for backward compatibility >+ else if ((matchRule & R_CAMELCASE_MATCH) != 0) { >+ // Verify sting pattern validity >+ int length = stringPattern.length(); >+ boolean validCamelCase = true; >+ boolean uppercase = false; >+ for (int i=0; i<length && validCamelCase; i++) { >+ char ch = stringPattern.charAt(i); >+ validCamelCase = i==0 ? ScannerHelper.isJavaIdentifierStart(ch) : ScannerHelper.isJavaIdentifierPart(ch); >+ // at least one uppercase character is need in CamelCase pattern >+ // (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=136313) >+ if (!uppercase) uppercase = ScannerHelper.isUpperCase(ch); >+ } >+ validCamelCase = validCamelCase && uppercase; >+ // Verify flags compatibility > if (validCamelCase) { > if ((matchRule & R_PREFIX_MATCH) != 0) { > if ((matchRule & R_CASE_SENSITIVE) != 0) { >@@ -1733,6 +2299,23 @@ > } > > /** >+ * Update depreciated flags if necessary in the given match rule. >+ * >+ * @param matchRule The match rule to update >+ * @return The updated match rule with the updated flags >+ */ >+static int updateMatchRule(int matchRule) { >+ if ((matchRule & R_CAMELCASE_MATCH) != 0) { >+ matchRule &= ~R_CAMELCASE_MATCH; >+ matchRule |= R_CAMEL_CASE_MATCH; >+ if ((matchRule & (R_PREFIX_MATCH | R_CASE_SENSITIVE)) == 0) { >+ matchRule |= R_PREFIX_MATCH; >+ } >+ } >+ return matchRule; >+} >+ >+/** > * @see java.lang.Object#toString() > */ > public String toString() { >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.142 >diff -u -r1.142 SearchEngine.java >--- search/org/eclipse/jdt/core/search/SearchEngine.java 6 Jul 2007 12:25:50 -0000 1.142 >+++ search/org/eclipse/jdt/core/search/SearchEngine.java 24 Aug 2007 05:50:06 -0000 >@@ -570,7 +570,7 @@ > * <li>{@link SearchPattern#R_PREFIX_MATCH} if the package name and type name are prefixes of the names > * of the searched types.</li> > * <li>{@link SearchPattern#R_PATTERN_MATCH} if the package name and type name contain wild-cards.</li> >- * <li>{@link SearchPattern#R_CAMELCASE_MATCH} if type name are camel case of the names of the searched types.</li> >+ * <li>{@link SearchPattern#R_CAMEL_CASE_MATCH} if type name are camel case of the names of the searched types.</li> > * </ul> > * combined with {@link SearchPattern#R_CASE_SENSITIVE}, > * e.g. {@link SearchPattern#R_EXACT_MATCH} | {@link SearchPattern#R_CASE_SENSITIVE} if an exact and case sensitive match is requested, >@@ -637,7 +637,7 @@ > * <li>{@link SearchPattern#R_PREFIX_MATCH} if the package name and type name are prefixes of the names > * of the searched types.</li> > * <li>{@link SearchPattern#R_PATTERN_MATCH} if the package name and type name contain wild-cards.</li> >- * <li>{@link SearchPattern#R_CAMELCASE_MATCH} if type name are camel case of the names of the searched types.</li> >+ * <li>{@link SearchPattern#R_CAMEL_CASE_MATCH} if type name are camel case of the names of the searched types.</li> > * </ul> > * combined with {@link SearchPattern#R_CASE_SENSITIVE}, > * e.g. {@link SearchPattern#R_EXACT_MATCH} | {@link SearchPattern#R_CASE_SENSITIVE} if an exact and case sensitive match is requested, >@@ -649,7 +649,7 @@ > * <li>{@link SearchPattern#R_PREFIX_MATCH} if the package name and type name are prefixes of the names > * of the searched types.</li> > * <li>{@link SearchPattern#R_PATTERN_MATCH} if the package name and type name contain wild-cards.</li> >- * <li>{@link SearchPattern#R_CAMELCASE_MATCH} if type name are camel case of the names of the searched types.</li> >+ * <li>{@link SearchPattern#R_CAMEL_CASE_MATCH} if type name are camel case of the names of the searched types.</li> > * </ul> > * combined with {@link SearchPattern#R_CASE_SENSITIVE}, > * e.g. {@link SearchPattern#R_EXACT_MATCH} | {@link SearchPattern#R_CASE_SENSITIVE} if an exact and case sensitive match is requested, >@@ -694,7 +694,15 @@ > IProgressMonitor progressMonitor) throws JavaModelException { > > TypeNameRequestorWrapper requestorWrapper = new TypeNameRequestorWrapper(nameRequestor); >- this.basicEngine.searchAllTypeNames(packageName, packageMatchRule, typeName, typeMatchRule, searchFor, scope, requestorWrapper, waitingPolicy, progressMonitor); >+ this.basicEngine.searchAllTypeNames(packageName, >+ packageMatchRule, >+ typeName, >+ SearchPattern.updateMatchRule(typeMatchRule), >+ searchFor, >+ scope, >+ requestorWrapper, >+ waitingPolicy, >+ progressMonitor); > } > > /** >@@ -716,7 +724,7 @@ > * <li>{@link SearchPattern#R_PREFIX_MATCH} if the package name and type name are prefixes of the names > * of the searched types.</li> > * <li>{@link SearchPattern#R_PATTERN_MATCH} if the package name and type name contain wild-cards.</li> >- * <li>{@link SearchPattern#R_CAMELCASE_MATCH} if type name are camel case of the names of the searched types.</li> >+ * <li>{@link SearchPattern#R_CAMEL_CASE_MATCH} if type name are camel case of the names of the searched types.</li> > * </ul> > * combined with {@link SearchPattern#R_CASE_SENSITIVE}, > * e.g. {@link SearchPattern#R_EXACT_MATCH} | {@link SearchPattern#R_CASE_SENSITIVE} if an exact and case sensitive match is requested, >@@ -732,7 +740,7 @@ > * <li>{@link SearchPattern#R_PREFIX_MATCH} if the package name and type name are prefixes of the names > * of the searched types.</li> > * <li>{@link SearchPattern#R_PATTERN_MATCH} if the package name and type name contain wild-cards.</li> >- * <li>{@link SearchPattern#R_CAMELCASE_MATCH} if type name are camel case of the names of the searched types.</li> >+ * <li>{@link SearchPattern#R_CAMEL_CASE_MATCH} if type name are camel case of the names of the searched types.</li> > * </ul> > * combined with {@link SearchPattern#R_CASE_SENSITIVE}, > * e.g. {@link SearchPattern#R_EXACT_MATCH} | {@link SearchPattern#R_CASE_SENSITIVE} if an exact and case sensitive match is requested, >@@ -778,7 +786,15 @@ > IProgressMonitor progressMonitor) throws JavaModelException { > > TypeNameMatchRequestorWrapper requestorWrapper = new TypeNameMatchRequestorWrapper(nameMatchRequestor, scope); >- this.basicEngine.searchAllTypeNames(packageName, packageMatchRule, typeName, typeMatchRule, searchFor, scope, requestorWrapper, waitingPolicy, progressMonitor); >+ this.basicEngine.searchAllTypeNames(packageName, >+ packageMatchRule, >+ typeName, >+ SearchPattern.updateMatchRule(typeMatchRule), >+ searchFor, >+ scope, >+ requestorWrapper, >+ waitingPolicy, >+ progressMonitor); > } > > /** >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.27 >diff -u -r1.27 Index.java >--- search/org/eclipse/jdt/internal/core/index/Index.java 15 Aug 2007 18:49:22 -0000 1.27 >+++ search/org/eclipse/jdt/internal/core/index/Index.java 24 Aug 2007 05:50:11 -0000 >@@ -47,7 +47,7 @@ > SearchPattern.R_PATTERN_MATCH | > SearchPattern.R_REGEXP_MATCH | > SearchPattern.R_CASE_SENSITIVE | >- SearchPattern.R_CAMELCASE_MATCH; >+ SearchPattern.R_CAMEL_CASE_MATCH; > > public static boolean isMatch(char[] pattern, char[] word, int matchRule) { > if (pattern == null) return true; >@@ -57,28 +57,25 @@ > if (wordLength == 0) return (matchRule & SearchPattern.R_PATTERN_MATCH) != 0 && patternLength == 1 && pattern[0] == '*'; > > // First test camel case if necessary >- boolean isCamelCase = (matchRule & SearchPattern.R_CAMELCASE_MATCH) != 0; >- if (isCamelCase && pattern[0] == word[0] && CharOperation.camelCaseMatch(pattern, word)) { >- return true; >+ 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)) { >+ return true; >+ } >+ if ((matchRule & SearchPattern.R_CASE_SENSITIVE) != 0) return false; > } > > // need to mask some bits of pattern rule (bug 79790) >- matchRule &= ~SearchPattern.R_CAMELCASE_MATCH; >+ matchRule &= ~SearchPattern.R_CAMEL_CASE_MATCH; > switch(matchRule & MATCH_RULE_INDEX_MASK) { > case SearchPattern.R_EXACT_MATCH : >- if (!isCamelCase) { >- return patternLength == wordLength && CharOperation.equals(pattern, word, false); >- } >- // fall through prefix match if camel case failed >+ return patternLength == wordLength && CharOperation.equals(pattern, word, false); > case SearchPattern.R_PREFIX_MATCH : > return patternLength <= wordLength && CharOperation.prefixEquals(pattern, word, false); > case SearchPattern.R_PATTERN_MATCH : > return CharOperation.match(pattern, word, false); > case SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE : >- if (!isCamelCase) { >- return pattern[0] == word[0] && patternLength == wordLength && CharOperation.equals(pattern, word); >- } >- // fall through prefix match if camel case failed >+ return pattern[0] == word[0] && patternLength == wordLength && CharOperation.equals(pattern, word); > case SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE : > return pattern[0] == word[0] && patternLength <= wordLength && CharOperation.prefixEquals(pattern, word); > case SearchPattern.R_PATTERN_MATCH | SearchPattern.R_CASE_SENSITIVE : >Index: model/org/eclipse/jdt/internal/core/SearchableEnvironment.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java,v >retrieving revision 1.68 >diff -u -r1.68 SearchableEnvironment.java >--- model/org/eclipse/jdt/internal/core/SearchableEnvironment.java 12 Oct 2006 09:21:42 -0000 1.68 >+++ model/org/eclipse/jdt/internal/core/SearchableEnvironment.java 24 Aug 2007 05:50:02 -0000 >@@ -380,7 +380,7 @@ > }; > try { > int matchRule = SearchPattern.R_PREFIX_MATCH; >- if (camelCaseMatch) matchRule |= SearchPattern.R_CAMELCASE_MATCH; >+ if (camelCaseMatch) matchRule |= SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH; > new BasicSearchEngine(this.workingCopies).searchAllTypeNames( > qualification, > SearchPattern.R_EXACT_MATCH, >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.47 >diff -u -r1.47 BasicSearchEngine.java >--- search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java 6 Jul 2007 12:25:50 -0000 1.47 >+++ search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java 24 Aug 2007 05:50:15 -0000 >@@ -246,7 +246,7 @@ > return "R_EXACT_MATCH"; //$NON-NLS-1$ > } > StringBuffer buffer = new StringBuffer(); >- for (int i=1; i<=8; i++) { >+ for (int i=1; i<=16; i++) { > int bit = matchRule & (1<<(i-1)); > if (bit != 0 && buffer.length()>0) buffer.append(" | "); //$NON-NLS-1$ > switch (bit) { >@@ -271,9 +271,12 @@ > case SearchPattern.R_REGEXP_MATCH: > buffer.append("R_REGEXP_MATCH"); //$NON-NLS-1$ > break; >- case SearchPattern.R_CAMELCASE_MATCH: >+ case 0x0080: // SearchPattern.R_CAMELCASE_MATCH: > buffer.append("R_CAMELCASE_MATCH"); //$NON-NLS-1$ > break; >+ case SearchPattern.R_CAMEL_CASE_MATCH: >+ buffer.append("R_CAMEL_CASE_MATCH"); //$NON-NLS-1$ >+ break; > } > } > return buffer.toString(); >@@ -454,21 +457,21 @@ > return false; > > if (patternTypeName != null) { >- boolean isCamelCase = (matchRule & SearchPattern.R_CAMELCASE_MATCH) != 0; >+ boolean isCamelCase = (matchRule & SearchPattern.R_CAMEL_CASE_MATCH) != 0; > int matchMode = matchRule & JavaSearchPattern.MATCH_MODE_MASK; > if (!isCaseSensitive && !isCamelCase) { > patternTypeName = CharOperation.toLowerCase(patternTypeName); > } > boolean matchFirstChar = !isCaseSensitive || patternTypeName[0] == typeName[0]; >- if (isCamelCase && matchFirstChar && CharOperation.camelCaseMatch(patternTypeName, typeName)) { >- return true; >+ if (isCamelCase) { >+ if (matchFirstChar && CharOperation.camelCaseMatch(patternTypeName, typeName, (matchRule & SearchPattern.R_PREFIX_MATCH) != 0)) { >+ return true; >+ } >+ if (isCaseSensitive) return false; > } > switch(matchMode) { > case SearchPattern.R_EXACT_MATCH : >- if (!isCamelCase) { >- return matchFirstChar && CharOperation.equals(patternTypeName, typeName, isCaseSensitive); >- } >- // fall through next case to match as prefix if camel case failed >+ return matchFirstChar && CharOperation.equals(patternTypeName, typeName, isCaseSensitive); > case SearchPattern.R_PREFIX_MATCH : > return matchFirstChar && CharOperation.prefixEquals(patternTypeName, typeName, isCaseSensitive); > case SearchPattern.R_PATTERN_MATCH : >@@ -842,7 +845,7 @@ > } > public boolean visit(TypeDeclaration memberTypeDeclaration, ClassScope classScope) { > if (match(typeSuffix, packageName, typeName, typeMatchRule, TypeDeclaration.kind(memberTypeDeclaration.modifiers), packageDeclaration, memberTypeDeclaration.name)) { >- // compute encloising type names >+ // compute enclosing type names > TypeDeclaration enclosing = memberTypeDeclaration.enclosingType; > char[][] enclosingTypeNames = CharOperation.NO_CHAR_CHAR; > while (enclosing != null) {
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 124624
:
76291
|
76305
|
76317
|
76748
| 76871