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 79464 Details for
Bug 201426
[search] New SearchPattern constant R_CAMEL_CASE_MATCH name may be misleading for users
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v03.txt (text/plain), 243.14 KB, created by
Frederic Fusier
on 2007-10-01 08:02:07 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2007-10-01 08:02:07 EDT
Size:
243.14 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#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.78 >diff -u -r1.78 TypeReferencePattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java 24 Aug 2007 05:59:05 -0000 1.78 >+++ search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java 1 Oct 2007 11:59:39 -0000 >@@ -51,7 +51,7 @@ > ((InternalSearchPattern)this).mustResolve = true; // always resolve (in case of a simple name reference being a potential match) > } > /* >- * Instanciate a type reference pattern with additional information for generics search >+ * Instantiate a type reference pattern with additional information for generics search > */ > public TypeReferencePattern(char[] qualification, char[] simpleName, String typeSignature, int matchRule) { > this(qualification, simpleName,matchRule); >@@ -65,7 +65,7 @@ > } > } > /* >- * Instanciate a type reference pattern with additional information for generics search >+ * Instantiate a type reference pattern with additional information for generics search > */ > public TypeReferencePattern(char[] qualification, char[] simpleName, IType type, int matchRule) { > this(qualification, simpleName,matchRule); >@@ -84,7 +84,7 @@ > if (this.simpleName != null) > return this.simpleName; > >- // Optimization, eg. type reference is 'org.eclipse.jdt.core.*' >+ // Optimization, e.g. type reference is 'org.eclipse.jdt.core.*' > if (this.currentSegment >= 0) > return this.segments[this.currentSegment]; > return null; >@@ -95,9 +95,9 @@ > protected boolean hasNextQuery() { > if (this.segments == null) return false; > >- // Optimization, eg. type reference is 'org.eclipse.jdt.core.*' >+ // Optimization, e.g. type reference is 'org.eclipse.jdt.core.*' > // if package has at least 4 segments, don't look at the first 2 since they are mostly >- // redundant (eg. in 'org.eclipse.jdt.core.*' 'org.eclipse' is used all the time) >+ // redundant (e.g. in 'org.eclipse.jdt.core.*' 'org.eclipse' is used all the time) > return --this.currentSegment >= (this.segments.length >= 4 ? 2 : 0); > } > >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.37 >diff -u -r1.37 ConstructorPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java 24 Aug 2007 05:59:05 -0000 1.37 >+++ search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java 1 Oct 2007 11:59:39 -0000 >@@ -265,7 +265,6 @@ > > switch(getMatchMode()) { > case R_EXACT_MATCH : >- if (this.isCamelCase) break; > if (this.declaringSimpleName != null && this.parameterCount >= 0 && !this.varargs) > key = createIndexKey(this.declaringSimpleName, this.parameterCount); > else { // do a prefix query with the declaringSimpleName >@@ -286,6 +285,10 @@ > case R_REGEXP_MATCH : > // TODO (frederic) implement regular expression match > break; >+ case R_CAMELCASE_MATCH: >+ case R_CAMELCASE_SAME_PART_COUNT_MATCH: >+ // do a prefix query with the declaringSimpleName >+ break; > } > > return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null >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.11 >diff -u -r1.11 MultiTypeDeclarationPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java 24 Aug 2007 05:59:05 -0000 1.11 >+++ search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java 1 Oct 2007 11:59:39 -0000 >@@ -38,7 +38,7 @@ > > this(matchRule); > >- if (isCaseSensitive() || qualifications == null) { >+ if (this.isCaseSensitive || qualifications == null) { > this.qualifications = qualifications; > } else { > int length = qualifications.length; >@@ -122,12 +122,10 @@ > // do a prefix query with the simpleName > break; > case R_EXACT_MATCH : >- if (!this.isCamelCase) { >- // do a prefix query with the simpleName >- matchRule &= ~R_EXACT_MATCH; >- matchRule |= R_PREFIX_MATCH; >- key = CharOperation.append(key, SEPARATOR); >- } >+ // do a prefix query with the simpleName >+ matchRule &= ~R_EXACT_MATCH; >+ matchRule |= R_PREFIX_MATCH; >+ key = CharOperation.append(key, SEPARATOR); > break; > case R_PATTERN_MATCH : > if (key[key.length - 1] != '*') >@@ -136,6 +134,10 @@ > case R_REGEXP_MATCH : > // TODO (frederic) implement regular expression match > break; >+ case R_CAMELCASE_MATCH: >+ case R_CAMELCASE_SAME_PART_COUNT_MATCH: >+ // do a prefix query with the simpleName >+ break; > } > > EntryResult[] entries = index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null >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.60 >diff -u -r1.60 MethodPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java 24 Aug 2007 05:59:05 -0000 1.60 >+++ search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java 1 Oct 2007 11:59:39 -0000 >@@ -308,7 +308,6 @@ > > switch(getMatchMode()) { > case R_EXACT_MATCH : >- if (this.isCamelCase) break; > if (this.selector != null && this.parameterCount >= 0 && !this.varargs) > key = createIndexKey(this.selector, this.parameterCount); > else { // do a prefix query with the selector >@@ -329,6 +328,10 @@ > case R_REGEXP_MATCH : > // TODO (frederic) implement regular expression match > break; >+ case R_CAMELCASE_MATCH: >+ case R_CAMELCASE_SAME_PART_COUNT_MATCH: >+ // do a prefix query with the selector >+ break; > } > > return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null >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.57 >diff -u -r1.57 TypeReferenceLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java 24 Aug 2007 05:59:05 -0000 1.57 >+++ search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java 1 Oct 2007 11:59:39 -0000 >@@ -112,12 +112,6 @@ > return IMPOSSIBLE_MATCH; > } > boolean matchFirstChar = !this.isCaseSensitive || (qualifiedPattern[0] == qualifiedTypeName[0]); >- 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: > case SearchPattern.R_PREFIX_MATCH: >@@ -135,6 +129,20 @@ > case SearchPattern.R_REGEXP_MATCH : > // TODO (frederic) implement regular expression match > break; >+ case SearchPattern.R_CAMELCASE_MATCH: >+ if (matchFirstChar && CharOperation.camelCaseMatch(qualifiedPattern, qualifiedTypeName, false)) { >+ return POSSIBLE_MATCH; >+ } >+ // if camel case does not match then try a insensitive prefix match if allowed >+ if (!this.isCaseSensitive && CharOperation.prefixEquals(qualifiedPattern, qualifiedTypeName, false)) { >+ return POSSIBLE_MATCH; >+ } >+ break; >+ case SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH: >+ if (matchFirstChar && CharOperation.camelCaseMatch(qualifiedPattern, qualifiedTypeName, true)) { >+ return POSSIBLE_MATCH; >+ } >+ break; > } > } > return IMPOSSIBLE_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.60 >diff -u -r1.60 SuperTypeReferencePattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java 24 Aug 2007 05:59:05 -0000 1.60 >+++ search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java 1 Oct 2007 11:59:39 -0000 >@@ -248,7 +248,6 @@ > // cannot include the superQualification since it may not exist in the index > switch(getMatchMode()) { > case R_EXACT_MATCH : >- if (this.isCamelCase) break; > // do a prefix query with the superSimpleName > matchRule &= ~R_EXACT_MATCH; > matchRule |= R_PREFIX_MATCH; >@@ -264,6 +263,10 @@ > case R_REGEXP_MATCH : > // TODO (frederic) implement regular expression match > break; >+ case R_CAMELCASE_MATCH: >+ case R_CAMELCASE_SAME_PART_COUNT_MATCH: >+ // do a prefix query with the superSimpleName >+ break; > } > > return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null >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.24 >diff -u -r1.24 JavaSearchPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java 24 Aug 2007 05:59:05 -0000 1.24 >+++ search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java 1 Oct 2007 11:59:39 -0000 >@@ -29,7 +29,6 @@ > * Whether this pattern is case sensitive. > */ > boolean isCaseSensitive; >- > /* > * Whether this pattern is camel case. > */ >@@ -42,7 +41,8 @@ > * <li>{@link #R_PREFIX_MATCH}</li> > * <li>{@link #R_PATTERN_MATCH}</li> > * <li>{@link #R_REGEXP_MATCH}</li> >- * <li>{@link #R_CAMEL_CASE_MATCH}</li> >+ * <li>{@link #R_CAMELCASE_MATCH}</li> >+ * <li>{@link #R_CAMELCASE_SAME_PART_COUNT_MATCH}</li> > * </ul> > */ > int matchMode; >@@ -55,7 +55,12 @@ > /** > * Mask used on match rule for match mode. > */ >- public static final int MATCH_MODE_MASK = R_EXACT_MATCH | R_PREFIX_MATCH | R_PATTERN_MATCH | R_REGEXP_MATCH; >+ public static final int MATCH_MODE_MASK = R_EXACT_MATCH >+ | R_PREFIX_MATCH >+ | R_PATTERN_MATCH >+ | R_REGEXP_MATCH >+ | R_CAMELCASE_MATCH >+ | R_CAMELCASE_SAME_PART_COUNT_MATCH; > > /** > * Mask used on match rule for generic relevance. >@@ -75,7 +80,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_CAMEL_CASE_MATCH) != 0; >+ this.isCamelCase = (rule & (R_CAMELCASE_MATCH | R_CAMELCASE_SAME_PART_COUNT_MATCH)) != 0; > this.matchCompatibility = rule & MATCH_COMPATIBILITY_MASK; > this.matchMode = rule & MATCH_MODE_MASK; > } >@@ -252,9 +257,6 @@ > output.append(this.typeSignatures[0]); > output.append("\", "); //$NON-NLS-1$ > } >- if (this.isCamelCase) { >- output.append("camel case + "); //$NON-NLS-1$ >- } > switch(getMatchMode()) { > case R_EXACT_MATCH : > output.append("exact match,"); //$NON-NLS-1$ >@@ -268,6 +270,12 @@ > case R_REGEXP_MATCH : > output.append("regexp match, "); //$NON-NLS-1$ > break; >+ case R_CAMELCASE_MATCH : >+ output.append("camel case match, "); //$NON-NLS-1$ >+ break; >+ case R_CAMELCASE_SAME_PART_COUNT_MATCH: >+ output.append("camel case same part count match, "); //$NON-NLS-1$ >+ break; > } > if (isCaseSensitive()) > output.append(" case sensitive"); //$NON-NLS-1$ >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.39 >diff -u -r1.39 PackageReferenceLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java 24 Aug 2007 05:59:05 -0000 1.39 >+++ search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java 1 Oct 2007 11:59:39 -0000 >@@ -95,34 +95,44 @@ > protected int matchLevelForTokens(char[][] tokens) { > if (this.pattern.pkgName == null) return ACCURATE_MATCH; > >- char[] packageName = null; >- if (this.isCamelCase) { >- packageName = CharOperation.concatWith(tokens, '.'); >- 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: > case SearchPattern.R_PREFIX_MATCH: >- if (packageName==null) packageName = CharOperation.concatWith(tokens, '.'); >- if (CharOperation.prefixEquals(this.pattern.pkgName, packageName, this.isCaseSensitive)) { >+ if (CharOperation.prefixEquals(this.pattern.pkgName, CharOperation.concatWith(tokens, '.'), this.isCaseSensitive)) { > return POSSIBLE_MATCH; > } > break; >+ > case SearchPattern.R_PATTERN_MATCH: > char[] patternName = this.pattern.pkgName[this.pattern.pkgName.length - 1] == '*' > ? this.pattern.pkgName > : CharOperation.concat(this.pattern.pkgName, ".*".toCharArray()); //$NON-NLS-1$ >- if (packageName==null) packageName = CharOperation.concatWith(tokens, '.'); >- if (CharOperation.match(patternName, packageName, this.isCaseSensitive)) { >+ if (CharOperation.match(patternName, CharOperation.concatWith(tokens, '.'), this.isCaseSensitive)) { > return POSSIBLE_MATCH; > } > break; >+ > case SearchPattern.R_REGEXP_MATCH : > // TODO (frederic) implement regular expression match > break; >+ >+ case SearchPattern.R_CAMELCASE_MATCH: >+ char[] packageName = CharOperation.concatWith(tokens, '.'); >+ if (CharOperation.camelCaseMatch(this.pattern.pkgName, packageName, false)) { >+ return POSSIBLE_MATCH; >+ } >+ // if camel case does not match then try a insensitive prefix match if allowed >+ if (!this.isCaseSensitive && CharOperation.prefixEquals(this.pattern.pkgName, packageName, false)) { >+ return POSSIBLE_MATCH; >+ } >+ break; >+ >+ case SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH: >+ packageName = CharOperation.concatWith(tokens, '.'); >+ if (CharOperation.camelCaseMatch(this.pattern.pkgName, CharOperation.concatWith(tokens, '.'), true)) { >+ return POSSIBLE_MATCH; >+ } >+ break; > } > return IMPOSSIBLE_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.62 >diff -u -r1.62 TypeDeclarationPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java 24 Aug 2007 05:59:05 -0000 1.62 >+++ search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java 1 Oct 2007 11:59:39 -0000 >@@ -264,7 +264,6 @@ > // do a prefix query with the simpleName > break; > case R_EXACT_MATCH : >- if (this.isCamelCase) break; > matchRule &= ~R_EXACT_MATCH; > if (this.simpleName != null) { > matchRule |= R_PREFIX_MATCH; >@@ -302,6 +301,10 @@ > case R_REGEXP_MATCH : > // TODO (frederic) implement regular expression match > break; >+ case R_CAMELCASE_MATCH: >+ case R_CAMELCASE_SAME_PART_COUNT_MATCH: >+ // do a prefix query with the simpleName >+ break; > } > > return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null >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.67 >diff -u -r1.67 PatternLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java 24 Aug 2007 05:59:05 -0000 1.67 >+++ search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java 1 Oct 2007 11:59:39 -0000 >@@ -23,7 +23,6 @@ > // store pattern info > protected int matchMode; > protected boolean isCaseSensitive; >-protected boolean isCamelCase; > protected boolean isEquivalentMatch; > protected boolean isErasureMatch; > protected boolean mustResolve; >@@ -118,7 +117,6 @@ > public PatternLocator(SearchPattern pattern) { > int matchRule = pattern.getMatchRule(); > this.isCaseSensitive = (matchRule & SearchPattern.R_CASE_SENSITIVE) != 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,23 +280,19 @@ > boolean matchFirstChar = !this.isCaseSensitive || pattern[0] == name[0]; > boolean sameLength = pattern.length == name.length; > boolean canBePrefix = name.length >= pattern.length; >- 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 (sameLength && matchFirstChar && CharOperation.equals(pattern, name, this.isCaseSensitive)) { > return POSSIBLE_MATCH | EXACT_FLAVOR; > } > 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) { >@@ -308,9 +302,26 @@ > return POSSIBLE_MATCH; > } > break; >+ > case SearchPattern.R_REGEXP_MATCH : > // TODO (frederic) implement regular expression match > break; >+ >+ case SearchPattern.R_CAMELCASE_MATCH: >+ if (CharOperation.camelCaseMatch(pattern, name, false)) { >+ return POSSIBLE_MATCH; >+ } >+ // if camel case does not match then try a insensitive prefix match if allowed >+ if (!this.isCaseSensitive && CharOperation.prefixEquals(pattern, name, false)) { >+ return POSSIBLE_MATCH; >+ } >+ break; >+ >+ case SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH: >+ if (CharOperation.camelCaseMatch(pattern, name, true)) { >+ return POSSIBLE_MATCH; >+ } >+ break; > } > return IMPOSSIBLE_MATCH; > } >@@ -712,25 +723,35 @@ > sourceName = getQualifiedSourceName(binding); > } > if (sourceName == null) return IMPOSSIBLE_MATCH; >- if ((this.matchMode & SearchPattern.R_PREFIX_MATCH) != 0) { >- if (CharOperation.prefixEquals(qualifiedPattern, sourceName, this.isCaseSensitive)) { >- return ACCURATE_MATCH; >- } >- } >- if (this.isCamelCase) { >- if ((qualifiedPattern.length>0 && sourceName.length>0 && qualifiedPattern[0] == sourceName[0])) { >- if (CharOperation.camelCaseMatch(qualifiedPattern, sourceName, (this.matchMode & SearchPattern.R_PREFIX_MATCH) != 0)) { >+ switch (this.matchMode) { >+ case SearchPattern.R_PREFIX_MATCH: >+ if (CharOperation.prefixEquals(qualifiedPattern, sourceName, this.isCaseSensitive)) { >+ return ACCURATE_MATCH; >+ } >+ break; >+ case SearchPattern.R_CAMELCASE_MATCH: >+ if ((qualifiedPattern.length>0 && sourceName.length>0 && qualifiedPattern[0] == sourceName[0])) { >+ if (CharOperation.camelCaseMatch(qualifiedPattern, sourceName, false)) { >+ return ACCURATE_MATCH; >+ } >+ } >+ if (!this.isCaseSensitive && CharOperation.prefixEquals(qualifiedPattern, sourceName, false)) { >+ return ACCURATE_MATCH; >+ } >+ break; >+ case SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH: >+ if ((qualifiedPattern.length>0 && sourceName.length>0 && qualifiedPattern[0] == sourceName[0])) { >+ if (CharOperation.camelCaseMatch(qualifiedPattern, sourceName, true)) { >+ return ACCURATE_MATCH; >+ } >+ } >+ break; >+ default: >+ if (CharOperation.match(qualifiedPattern, sourceName, this.isCaseSensitive)) { > return ACCURATE_MATCH; > } >- } >- if (!this.isCaseSensitive && this.matchMode == SearchPattern.R_EXACT_MATCH) { >- boolean matchPattern = CharOperation.equals(qualifiedPattern, sourceName, false); >- return matchPattern ? ACCURATE_MATCH : IMPOSSIBLE_MATCH; >- } > } >- boolean matchPattern = CharOperation.match(qualifiedPattern, sourceName, this.isCaseSensitive); >- return matchPattern ? ACCURATE_MATCH : IMPOSSIBLE_MATCH; >- >+ return 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.30 >diff -u -r1.30 AndPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/AndPattern.java 24 Aug 2007 05:59:05 -0000 1.30 >+++ search/org/eclipse/jdt/internal/core/search/matching/AndPattern.java 1 Oct 2007 11:59:38 -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_CAMEL_CASE_MATCH); >+ | (combined & (R_CAMELCASE_MATCH | R_CAMELCASE_SAME_PART_COUNT_MATCH)); > } > > public AndPattern(SearchPattern leftPattern, SearchPattern rightPattern) { >Index: buildnotes_jdt-core.html >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/buildnotes_jdt-core.html,v >retrieving revision 1.6096 >diff -u -r1.6096 buildnotes_jdt-core.html >--- buildnotes_jdt-core.html 28 Sep 2007 18:28:26 -0000 1.6096 >+++ buildnotes_jdt-core.html 1 Oct 2007 11:59:36 -0000 >@@ -49,10 +49,117 @@ > <ul> > <li>Added API <code>IJavaElementDelta#F_RESOLVED_CLASSPATH_CHANGED</code>. This flag is set when the resolved classpath of a Java project changes. > This is independent from <code>IJavaElementDelta#F_CLASSPATH_CHANGED</code> which indicates that the raw classpath has changed.</li> >+<li>Added API <code>SearchPattern#R_CAMELCASE_SAME_PART_COUNT_MATCH</code>.<br> >+This constant tells Search Engine to report matches which have <b>exactly</b> >+the same count of parts (i.e. uppercase characters) than the Camel Case pattern >+(see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=201426">bug 201426</a>): >+<pre> >+/** >+ * Match rule: The search pattern contains a Camel Case expression with >+ * a strict expected number of parts. >+ * >+ * Examples: >+ * . 'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types, >+ * but not 'HashMapEntry' >+ * . 'HMap' type string pattern will still match previous 'HashMap' and >+ * 'HtmlMapper' types, but not 'HighMagnitude' >+ * >+ * This rule is not intended to be combined with any other match rule. In case >+ * of other match rule flags are combined with this one, then match rule validation >+ * will return a modified rule in order to perform a better appropriate search request >+ * (see {@link #validateMatchRule(String, int)} for more details). >+ * >+ * @see CharOperation#camelCaseMatch(char[], char[], boolean) for a detailed >+ * explanation of Camel Case matching. >+ * >+ * @since 3.4 >+ */ >+public static final int R_CAMELCASE_SAME_PART_COUNT_MATCH = 0x0100; >+</pre> >+Note that this constant replace previous one <code>R_CAMEL_CASE_MATCH</code> >+added while fixing <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=124624">bug 124624</a>.<br> >+Also note that <code>R_CAMELCASE_MATCH</code> is no longer deprecated as, finally, >+Camel Case match rule flags are not supposed to be combined with other ones (e.g. >+<code>R_PREFIX_MATCH</code> or <code>R_PATTERN_MATCH</code>). >+</li> >+<li><code>CharOperation</code> and <code>SearchPattern</code> Camel Case API methods >+added while fixing <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=124624">bug 124624</a>) >+have been modified to clarify the behavior of the additional boolean parameter.<br> >+This parameter now indicates whether the pattern and the name should have the same >+count of parts (i.e. uppercase characters) or not: >+<pre> >+/** >+ *... >+ * CamelCase can be restricted to match only the same count of parts. When this >+ * restriction is specified the given pattern and the given name must have <b>exactly</b> >+ * the same number of parts (i.e. the same number of uppercase characters). >+ * For instance, 'HM' , 'HaMa' and 'HMap' patterns will match 'HashMap' and >+ * 'HatMapper' <b>but not</b> 'HashMapEntry'. >+ *... >+ * . pattern = "HM".toCharArray() >+ * name = "HashMapEntry".toCharArray() >+ * result => (samePartCount == false) >+ *... >+ * @param samePartCount flag telling whether the pattern and the name should >+ * have the same count of parts or not. >+ * For example: >+ * . 'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types, >+ * but not 'HashMapEntry' >+ * . 'HMap' type string pattern will still match previous 'HashMap' and >+ * 'HtmlMapper' types, but not 'HighMagnitude' >+ * @return true if the pattern matches the given name, false otherwise >+ * @since 3.4 >+ */ >+public static final boolean camelCaseMatch(char[] pattern, char[] name, boolean samePartCount) { >+... >+} >+ >+/** >+ *... >+ * CamelCase can be restricted to match only the same count of parts. When this >+ * restriction is specified the given pattern and the given name must have <b>exactly</b> >+ * the same number of parts (i.e. the same number of uppercase characters). >+ * For instance, 'HM' , 'HaMa' and 'HMap' patterns will match 'HashMap' and >+ * 'HatMapper' <b>but not</b> 'HashMapEntry'. >+ *... >+ * . pattern = "HM".toCharArray() >+ * patternStart = 0 >+ * patternEnd = 2 >+ * name = "HashMapEntry".toCharArray() >+ * nameStart = 0 >+ * nameEnd = 12 >+ * result => (samePartCount == false) >+ *... >+ * @param samePartCount flag telling whether the pattern and the name should >+ * have the same count of parts or not. >+ * For example: >+ * . 'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types, >+ * but not 'HashMapEntry' >+ * . 'HMap' type string pattern will still match previous 'HashMap' and >+ * 'HtmlMapper' types, but not 'HighMagnitude' >+ * @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 similar modifications have been done on <code>SearchPattern</code> >+corresponding methods: >+<pre> >+public static final boolean camelCaseMatch(String pattern, String name, boolean samePartCount) { >+... >+} >+public static final boolean camelCaseMatch(String pattern, int patternStart, int patternEnd, String name, int nameStart, int nameEnd, boolean samePartCount) { >+... >+} >+</li> > </ul> > > <h3>Problem Reports Fixed</h3> >-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=204339">204339</a> >+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=201426">201426</a> >+[search] New SearchPattern constant R_CAMEL_CASE_MATCH name may be misleading for users >+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=204339">204339</a> > [compiler] Invalid length for missing package declaration in empty package-info.java file > <br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=203587">203587</a> > Improve messages consistency in case of generic methods having same erasure >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.79 >diff -u -r1.79 CharOperation.java >--- compiler/org/eclipse/jdt/core/compiler/CharOperation.java 24 Aug 2007 05:59:05 -0000 1.79 >+++ compiler/org/eclipse/jdt/core/compiler/CharOperation.java 1 Oct 2007 11:59:37 -0000 >@@ -202,34 +202,33 @@ > * 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)}). >+ * Using this method allows matching names to have more parts than the specified >+ * pattern (see {@link #camelCaseMatch(char[], char[], boolean)}).<br> >+ * For instance, 'HM' , 'HaMa' and 'HMap' patterns will match 'HashMap', >+ * 'HatMapper' <b>and also</b> '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' } >+ * <li> pattern = "NPE".toCharArray() >+ * name = "NullPointerException".toCharArray() > * 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' } >+ * <li> pattern = "NPE".toCharArray() >+ * name = "NoPermissionException".toCharArray() > * 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' } >+ * <li> pattern = "NuPoEx".toCharArray() >+ * name = "NullPointerException".toCharArray() > * 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' } >+ * <li> pattern = "NuPoEx".toCharArray() >+ * name = "NoPermissionException".toCharArray() > * 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' } >+ * <li> pattern = "npe".toCharArray() >+ * name = "NullPointerException".toCharArray() > * 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' } >+ * <li> pattern = "IPL3".toCharArray() >+ * name = "IPerspectiveListener3".toCharArray() > * 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' } >+ * <li> pattern = "HM".toCharArray() >+ * name = "HashMapEntry".toCharArray() > * result => true</li> > * </ol></pre> > * >@@ -244,7 +243,7 @@ > if (name == null) > return false; // null name cannot match > >- return camelCaseMatch(pattern, 0, pattern.length, name, 0, name.length, true/*prefix match*/); >+ return camelCaseMatch(pattern, 0, pattern.length, name, 0, name.length, false/*not the same count of parts*/); > } > > /** >@@ -272,74 +271,58 @@ > * 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'. >+ * CamelCase can be restricted to match only the same count of parts. When this >+ * restriction is specified the given pattern and the given name must have <b>exactly</b> >+ * the same number of parts (i.e. the same number of uppercase characters).<br> >+ * For instance, 'HM' , 'HaMa' and 'HMap' patterns will match 'HashMap' and >+ * 'HatMapper' <b>but not</b> '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' } >+ * <li> pattern = "NPE".toCharArray() >+ * name = "NullPointerException".toCharArray() > * 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' } >+ * <li> pattern = "NPE".toCharArray() >+ * name = "NoPermissionException".toCharArray() > * 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' } >+ * <li> pattern = "NuPoEx".toCharArray() >+ * name = "NullPointerException".toCharArray() > * 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' } >+ * <li> pattern = "NuPoEx".toCharArray() >+ * name = "NoPermissionException".toCharArray() > * 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' } >+ * <li> pattern = "npe".toCharArray() >+ * name = "NullPointerException".toCharArray() > * 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' } >+ * <li> pattern = "IPL3".toCharArray() >+ * name = "IPerspectiveListener3".toCharArray() > * 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> >+ * <li> pattern = "HM".toCharArray() >+ * name = "HashMapEntry".toCharArray() >+ * result => (samePartCount == false)</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. >+ * @param samePartCount flag telling whether the pattern and the name should >+ * have the same count of parts or not.<br> >+ * For example: > * <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> >+ * <li>'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types, >+ * but not 'HashMapEntry'</li> >+ * <li>'HMap' type string pattern will still match previous 'HashMap' and >+ * 'HtmlMapper' types, but not 'HighMagnitude'</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) { >+public static final boolean camelCaseMatch(char[] pattern, char[] name, boolean samePartCount) { > 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); >+ return camelCaseMatch(pattern, 0, pattern.length, name, 0, name.length, samePartCount); > } > > /** >@@ -373,71 +356,62 @@ > * 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)}). >+ * Using this method allows matching names to have more parts than the specified >+ * pattern (see {@link #camelCaseMatch(char[], int, int, char[], int, int, boolean)}).<br> >+ * For instance, 'HM' , 'HaMa' and 'HMap' patterns will match 'HashMap', >+ * 'HatMapper' <b>and also</b> 'HashMapEntry'. > * <p> > * Examples: > * <ol> >- * <li><pre> >- * 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 >- * </pre> >- * </li> >- * <li><pre> >- * 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 >- * </pre> >- * </li> >- * <li><pre> >- * 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 >- * </pre> >- * </li> >- * <li><pre> >- * 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 >- * </pre> >- * </li> >- * <li><pre> >- * 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 >- * </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> >+ * <li> pattern = "NPE".toCharArray() >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = "NullPointerException".toCharArray() >+ * nameStart = 0 >+ * nameEnd = 20 >+ * result => true</li> >+ * <li> pattern = "NPE".toCharArray() >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = "NoPermissionException".toCharArray() >+ * nameStart = 0 >+ * nameEnd = 21 >+ * result => true</li> >+ * <li> pattern = "NuPoEx".toCharArray() >+ * patternStart = 0 >+ * patternEnd = 6 >+ * name = "NullPointerException".toCharArray() >+ * nameStart = 0 >+ * nameEnd = 20 >+ * result => true</li> >+ * <li> pattern = "NuPoEx".toCharArray() >+ * patternStart = 0 >+ * patternEnd = 6 >+ * name = "NoPermissionException".toCharArray() >+ * nameStart = 0 >+ * nameEnd = 21 >+ * result => false</li> >+ * <li> pattern = "npe".toCharArray() >+ * patternStart = 0 >+ * patternEnd = 3 >+ * name = "NullPointerException".toCharArray() >+ * nameStart = 0 >+ * nameEnd = 20 >+ * result => false</li> >+ * <li> pattern = "IPL3".toCharArray() >+ * patternStart = 0 >+ * patternEnd = 4 >+ * name = "IPerspectiveListener3".toCharArray() >+ * nameStart = 0 >+ * nameEnd = 21 >+ * result => true</li> >+ * <li> pattern = "HM".toCharArray() >+ * patternStart = 0 >+ * patternEnd = 2 >+ * name = "HashMapEntry".toCharArray() >+ * nameStart = 0 >+ * nameEnd = 12 >+ * result => true</li> > * </ol> > * > * @param pattern the given pattern >@@ -450,7 +424,7 @@ > * @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*/); >+ return camelCaseMatch(pattern, patternStart, patternEnd, name, nameStart, nameEnd, false/*not the same count of parts*/); > } > > /** >@@ -481,79 +455,64 @@ > * 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'. >+ * CamelCase can be restricted to match only the same count of parts. When this >+ * restriction is specified the given pattern and the given name must have <b>exactly</b> >+ * the same number of parts (i.e. the same number of uppercase characters).<br> >+ * For instance, 'HM' , 'HaMa' and 'HMap' patterns will match 'HashMap' and >+ * 'HatMapper' <b>but not</b> 'HashMapEntry'. > * <p> > * <pre> > * Examples: > * <ol> >- * <li> pattern = { 'N', 'P', 'E' } >+ * <li> pattern = "NPE".toCharArray() > * 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' } >+ * name = "NullPointerException".toCharArray() > * nameStart = 0 > * nameEnd = 20 > * result => true</li> >- * <li> pattern = { 'N', 'P', 'E' } >+ * <li> pattern = "NPE".toCharArray() > * 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' } >+ * name = "NoPermissionException".toCharArray() > * nameStart = 0 > * nameEnd = 21 > * result => true</li> >- * <li> pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } >+ * <li> pattern = "NuPoEx".toCharArray() > * 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' } >+ * name = "NullPointerException".toCharArray() > * nameStart = 0 > * nameEnd = 20 > * result => true</li> >- * <li> pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } >+ * <li> pattern = "NuPoEx".toCharArray() > * 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' } >+ * name = "NoPermissionException".toCharArray() > * nameStart = 0 > * nameEnd = 21 > * result => false</li> >- * <li> pattern = { 'n', p', 'e' } >+ * <li> pattern = "npe".toCharArray() > * 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' } >+ * name = "NullPointerException".toCharArray() > * nameStart = 0 > * nameEnd = 20 > * result => false</li> >- * <li> pattern = { 'I', 'P', 'L', '3' } >+ * <li> pattern = "IPL3".toCharArray() > * 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' } >+ * name = "IPerspectiveListener3".toCharArray() > * nameStart = 0 > * nameEnd = 21 > * result => true</li> >- * <li> pattern = { 'H', M' } >+ * <li> pattern = "HM".toCharArray() > * patternStart = 0 > * patternEnd = 2 >- * name = { 'H', 'a', 's', 'h', 'M', 'a', 'p', 'E', 'n', 't', 'r', 'y' } >+ * name = "HashMapEntry".toCharArray() > * 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> >+ * result => (samePartCount == false)</li> > * </ol> > * </pre> > * >@@ -563,24 +522,28 @@ > * @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. >+ * @param samePartCount flag telling whether the pattern and the name should >+ * have the same count of parts or not.<br> >+ * For example: > * <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> >+ * <li>'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types, >+ * but not 'HashMapEntry'</li> >+ * <li>'HMap' type string pattern will still match previous 'HashMap' and >+ * 'HtmlMapper' types, but not 'HighMagnitude'</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) { >+public static final boolean camelCaseMatch(char[] pattern, int patternStart, int patternEnd, char[] name, int nameStart, int nameEnd, boolean samePartCount) { >+ >+ /* !!!!!!!!!! WARNING !!!!!!!!!! >+ * The content of this method has been fully copied to >+ * SearchPattern#camelCaseMatch(String, int, int, String, int, int, boolean). >+ * >+ * So, if current method is modified, do NOT forget to copy again its content >+ * to SearchPattern corresponding method! >+ */ >+ > if (name == null) > return false; // null name cannot match > if (pattern == null) >@@ -607,29 +570,19 @@ > 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[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 if the name can have additional parts (i.e. uppercase characters) or is also exhausted >+ if (!samePartCount || iName == nameEnd) return true; > >- // it's a match only if name has no more uppercase characters (exact mode) >+ // otherwise it's a match only if the name has no more uppercase characters > while (true) { > if (iName == nameEnd) { >- // we have exhausted name, so it's a match >+ // we have exhausted the name, so it's a match > return true; > } > nameChar = name[iName]; >+ // test if the name character is uppercase > 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; > } > } >@@ -641,7 +594,7 @@ > } > > if (iName == nameEnd){ >- // We have exhausted name (and not pattern), so it's not a match >+ // We have exhausted the name (and not the pattern), so it's not a match > return false; > } > >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.72 >diff -u -r1.72 SearchPattern.java >--- search/org/eclipse/jdt/core/search/SearchPattern.java 17 Sep 2007 14:45:45 -0000 1.72 >+++ search/org/eclipse/jdt/core/search/SearchPattern.java 1 Oct 2007 11:59:38 -0000 >@@ -150,18 +150,10 @@ > * 'NullPointerException' type.</li> > * </ul> > * >- * Can be combined to {@link #R_PREFIX_MATCH} match rule. For example, >- * when prefix match rule is combined with Camel Case match rule, >- * 'nPE' pattern will match 'nPException'. >- *<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 '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. >+ * This rule is not intended to be combined with any other match rule. In case >+ * of other match rule flags are combined with this one, then match rule validation >+ * will return a modified rule in order to perform a better appropriate search request >+ * (see {@link #validateMatchRule(String, int)} for more details). > * <p> > * @see #camelCaseMatch(String, String) for a detailed explanation of Camel > * Case matching. >@@ -172,47 +164,36 @@ > > /** > * 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). >+ * a strict expected number of parts. > * <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>'HMap' type string pattern will still match previous 'HashMap' and >+ * 'HtmlMapper' types, but not 'HighMagnitude' > * </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'. >+ * This rule is not intended to be combined with any other match rule. In case >+ * of other match rule flags are combined with this one, then match rule validation >+ * will return a modified rule in order to perform a better appropriate search request >+ * (see {@link #validateMatchRule(String, int)} for more details). > * <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 >- * <p><b>WARNING: work is still in progress on this new constant due to >- * bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=201426.<br> >- * So, there's high chance that this constant will be renamed and its behavior >- * slightly changed in next milestone...</b> > */ >- public static final int R_CAMEL_CASE_MATCH = 0x0100; >+ public static final int R_CAMELCASE_SAME_PART_COUNT_MATCH = 0x0100; > >- private static final int MODE_MASK = R_EXACT_MATCH | R_PREFIX_MATCH | R_PATTERN_MATCH | R_REGEXP_MATCH; >+ private static final int MODE_MASK = R_EXACT_MATCH >+ | R_PREFIX_MATCH >+ | R_PATTERN_MATCH >+ | R_REGEXP_MATCH >+ | R_CAMELCASE_MATCH >+ | R_CAMELCASE_SAME_PART_COUNT_MATCH; > > private int matchRule; > >@@ -221,16 +202,32 @@ > * 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} 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> >+ * @param matchRule one of following match rule >+ * <ul> >+ * <li>{@link #R_EXACT_MATCH}</li> >+ * <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_CAMELCASE_SAME_PART_COUNT_MATCH}</li> >+ * </ul> >+ * which may be also combined with one of following flag: >+ * <ul> >+ * <li>{@link #R_CASE_SENSITIVE}</li> >+ * <li>{@link #R_ERASURE_MATCH}</li> >+ * <li>{@link #R_EQUIVALENT_MATCH}</li> >+ * </ul> >+ * For example, >+ * <ul> >+ * <li>{@link #R_EXACT_MATCH} | {@link #R_CASE_SENSITIVE}: if an exact >+ * and case sensitive match is requested,</li> >+ * <li>{@link #R_PREFIX_MATCH} if a case insensitive prefix match is requested</li> >+ * <li>{@link #R_EXACT_MATCH} | {@link #R_ERASURE_MATCH}: if a case >+ * insensitive and erasure match is requested.</li> >+ * </ul> >+ * Note that {@link #R_ERASURE_MATCH} or {@link #R_EQUIVALENT_MATCH} has no effect >+ * on non-generic types/methods search. >+ * <p> > * Note also that default behavior for generic types/methods search is to find exact matches. > */ > public SearchPattern(int matchRule) { >@@ -239,7 +236,14 @@ > if ((matchRule & (R_EQUIVALENT_MATCH | R_ERASURE_MATCH )) == 0) { > this.matchRule |= R_FULL_MATCH; > } >- this.matchRule = updateMatchRule(this.matchRule); >+ if ((matchRule & R_CAMELCASE_SAME_PART_COUNT_MATCH) != 0) { >+ // reset other incompatible flags >+ this.matchRule &= ~R_CAMELCASE_MATCH; >+ this.matchRule &= ~R_PREFIX_MATCH; >+ } else if ((matchRule & R_CAMELCASE_MATCH) != 0) { >+ // reset other incompatible flags >+ this.matchRule &= ~R_PREFIX_MATCH; >+ } > } > > /** >@@ -267,8 +271,10 @@ > * 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)}). >+ * Using this method allows matching names to have more parts than the specified >+ * pattern (see {@link #camelCaseMatch(String, String, boolean)}).<br> >+ * For instance, 'HM' , 'HaMa' and 'HMap' patterns will match 'HashMap', >+ * 'HatMapper' <b>and also</b> 'HashMapEntry'. > * <p> > * <pre> > * Examples: >@@ -306,7 +312,7 @@ > if (name == null) > return false; // null name cannot match > >- return camelCaseMatch(pattern, 0, pattern.length(), name, 0, name.length(), true/*prefix match*/); >+ return camelCaseMatch(pattern, 0, pattern.length(), name, 0, name.length(), false/*not the same count of parts*/); > } > > /** >@@ -334,19 +340,11 @@ > * 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'. >+ * CamelCase can be restricted to match only the same count of parts. When this >+ * restriction is specified the given pattern and the given name must have <b>exactly</b> >+ * the same number of parts (i.e. the same number of uppercase characters).<br> >+ * For instance, 'HM' , 'HaMa' and 'HMap' patterns will match 'HashMap' and >+ * 'HatMapper' <b>but not</b> 'HashMapEntry'. > * <p> > * <pre> > * Examples: >@@ -364,10 +362,7 @@ > * result => true</li> > * <li> pattern = "HM" > * name = "HashMapEntry" >- * result => (prefixMatch == true)</li> >- * <li> pattern = "HMap" >- * name = "HatMapper" >- * result => (prefixMatch == true)</li> >+ * result => (samePartCount == false)</li> > * </ol></pre> > * > * @see #camelCaseMatch(String, int, int, String, int, int, boolean) for algorithm >@@ -375,33 +370,25 @@ > * > * @param pattern the given pattern > * @param name the given name >- * @param prefixMatch flag telling whether the pattern can match name prefix or not. >+ * @param samePartCount flag telling whether the pattern and the name should >+ * have the same count of parts or not.<br> >+ * For example: > * <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> >+ * <li>'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types, >+ * but not 'HashMapEntry'</li> >+ * <li>'HMap' type string pattern will still match previous 'HashMap' and >+ * 'HtmlMapper' types, but not 'HighMagnitude'</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) { >+public static final boolean camelCaseMatch(String pattern, String name, boolean samePartCount) { > 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); >+ return camelCaseMatch(pattern, 0, pattern.length(), name, 0, name.length(), samePartCount); > } > > /** >@@ -435,8 +422,10 @@ > * 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)}). >+ * Using this method allows matching names to have more parts than the specified >+ * pattern (see {@link #camelCaseMatch(String, int, int, String, int, int, boolean)}).<br> >+ * For instance, 'HM' , 'HaMa' and 'HMap' patterns will match 'HashMap', >+ * 'HatMapper' <b>and also</b> 'HashMapEntry'. > * <p> > * <pre>Examples:<ol> > * <li> pattern = "NPE" >@@ -507,7 +496,7 @@ > * @since 3.2 > */ > public static final boolean camelCaseMatch(String pattern, int patternStart, int patternEnd, String name, int nameStart, int nameEnd) { >- return camelCaseMatch(pattern, patternStart, patternEnd, name, nameStart, nameEnd, true/*prefix match*/); >+ return camelCaseMatch(pattern, patternStart, patternEnd, name, nameStart, nameEnd, false/*not the same count of parts*/); > } > > /** >@@ -538,19 +527,11 @@ > * 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'. >+ * CamelCase can be restricted to match only the same count of parts. When this >+ * restriction is specified the given pattern and the given name must have <b>exactly</b> >+ * the same number of parts (i.e. the same number of uppercase characters).<br> >+ * For instance, 'HM' , 'HaMa' and 'HMap' patterns will match 'HashMap' and >+ * 'HatMapper' <b>but not</b> 'HashMapEntry'. > * <p> > * <pre>Examples:<ol> > * <li> pattern = "NPE" >@@ -601,14 +582,7 @@ > * 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> >+ * result => (samePartCount == false)</li> > * </ol></pre> > * > * @see CharOperation#camelCaseMatch(char[], int, int, char[], int, int, boolean) >@@ -620,35 +594,29 @@ > * @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. >+ * @param samePartCount flag telling whether the pattern and the name should >+ * have the same count of parts or not.<br> >+ * For example: > * <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> >+ * <li>'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types, >+ * but not 'HashMapEntry'</li> >+ * <li>'HMap' type string pattern will still match previous 'HashMap' and >+ * 'HtmlMapper' types, but not 'HighMagnitude'</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) { >+public static final boolean camelCaseMatch(String pattern, int patternStart, int patternEnd, String name, int nameStart, int nameEnd, boolean samePartCount) { > >- /* >+ /* !!!!!!!!!! WARNING !!!!!!!!!! > * The algorithm of this method has been entirely copied from >- * CharOperation#camelCaseMatch(char[], int, int, char[], int, int, boolean) >+ * 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... >+ * >+ * So, do NOT modify this method directly to fix any bug but modify first the >+ * corresponding CharOperation method and do the copy again to be sure that >+ * these two methods are kept synchronized. > */ > > if (name == null) >@@ -665,7 +633,7 @@ > // first char must strictly match (upper/lower) > return false; > } >- >+ > char patternChar, nameChar; > int iPattern = patternStart; > int iName = nameStart; >@@ -677,29 +645,19 @@ > 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 if the name can have additional parts (i.e. uppercase characters) or is also exhausted >+ if (!samePartCount || iName == nameEnd) return true; > >- // it's a match only if name has no more uppercase characters (exact mode) >+ // otherwise it's a match only if the name has no more uppercase characters > while (true) { > if (iName == nameEnd) { >- // we have exhausted name, so it's a match >+ // we have exhausted the name, so it's a match > return true; > } > nameChar = name.charAt(iName); >+ // test if the name character is uppercase > 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; > } > } >@@ -711,7 +669,7 @@ > } > > if (iName == nameEnd){ >- // We have exhausted name (and not pattern), so it's not a match >+ // We have exhausted the name (and not the pattern), so it's not a match > return false; > } > >@@ -1410,16 +1368,32 @@ > * {@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} 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> >+ * @param matchRule one of the following match rule >+ * <ul> >+ * <li>{@link #R_EXACT_MATCH}</li> >+ * <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_CAMELCASE_SAME_PART_COUNT_MATCH}</li> >+ * </ul> >+ * which may be also combined with one of the following flag: >+ * <ul> >+ * <li>{@link #R_CASE_SENSITIVE}</li> >+ * <li>{@link #R_ERASURE_MATCH}</li> >+ * <li>{@link #R_EQUIVALENT_MATCH}</li> >+ * </ul> >+ * For example, >+ * <ul> >+ * <li>{@link #R_EXACT_MATCH} | {@link #R_CASE_SENSITIVE}: if an exact >+ * and case sensitive match is requested,</li> >+ * <li>{@link #R_PREFIX_MATCH} if a case insensitive prefix match is requested</li> >+ * <li>{@link #R_EXACT_MATCH} | {@link #R_ERASURE_MATCH}: if a case >+ * insensitive and erasure match is requested.</li> >+ * </ul> >+ * Note that {@link #R_ERASURE_MATCH} or {@link #R_EQUIVALENT_MATCH} has no effect >+ * on non-generic types/methods search. >+ * <p> > * Note also that default behavior for generic types/methods search is to find exact matches. > * @return a search pattern on the given string pattern, or <code>null</code> if the string pattern is ill-formed > */ >@@ -1557,16 +1531,32 @@ > * 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} 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> >+ * @param matchRule one of the following match rule >+ * <ul> >+ * <li>{@link #R_EXACT_MATCH}</li> >+ * <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_CAMELCASE_SAME_PART_COUNT_MATCH}</li> >+ * </ul> >+ * which may be also combined with one of the following flag: >+ * <ul> >+ * <li>{@link #R_CASE_SENSITIVE}</li> >+ * <li>{@link #R_ERASURE_MATCH}</li> >+ * <li>{@link #R_EQUIVALENT_MATCH}</li> >+ * </ul> >+ * For example, >+ * <ul> >+ * <li>{@link #R_EXACT_MATCH} | {@link #R_CASE_SENSITIVE}: if an exact >+ * and case sensitive match is requested,</li> >+ * <li>{@link #R_PREFIX_MATCH} if a case insensitive prefix match is requested</li> >+ * <li>{@link #R_EXACT_MATCH} | {@link #R_ERASURE_MATCH}: if a case >+ * insensitive and erasure match is requested.</li> >+ * </ul> >+ * Note that {@link #R_ERASURE_MATCH} or {@link #R_EQUIVALENT_MATCH} has no effect >+ * on non-generic types/methods search. >+ * <p> > * 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 >@@ -1581,6 +1571,9 @@ > ignoreDeclaringType = (limitTo & IJavaSearchConstants.IGNORE_DECLARING_TYPE) != 0; > ignoreReturnType = (limitTo & IJavaSearchConstants.IGNORE_RETURN_TYPE) != 0; > } >+ if ((matchRule = validateMatchRule(null, matchRule)) == -1) { >+ return null; >+ } > char[] declaringSimpleName = null; > char[] declaringQualification = null; > switch (element.getElementType()) { >@@ -2140,26 +2133,19 @@ > 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_CAMEL_CASE_MATCH) != 0; > int matchMode = this.matchRule & MODE_MASK; > boolean emptyPattern = pattern.length == 0; >- boolean isPrefix = (this.matchRule & R_PREFIX_MATCH) != 0; >- if (isPrefix && emptyPattern) return true; >+ if (emptyPattern && (this.matchRule & R_PREFIX_MATCH) != 0) 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) { >- if (matchFirstChar && CharOperation.camelCaseMatch(pattern, name, isPrefix)) { >- return true; >- } >- if (isCaseSensitive) return false; >- } > switch (matchMode) { > case R_EXACT_MATCH : > if (sameLength && matchFirstChar) { > return CharOperation.equals(pattern, name, isCaseSensitive); > } > break; >+ > case R_PREFIX_MATCH : > if (canBePrefix && matchFirstChar) { > return CharOperation.prefixEquals(pattern, name, isCaseSensitive); >@@ -2172,6 +2158,19 @@ > pattern = CharOperation.toLowerCase(pattern); > return CharOperation.match(pattern, name, isCaseSensitive); > >+ case SearchPattern.R_CAMELCASE_MATCH: >+ if (matchFirstChar && CharOperation.camelCaseMatch(pattern, name, false)) { >+ return true; >+ } >+ // only test case insensitive as CamelCase already verified prefix case sensitive >+ if (!isCaseSensitive && matchFirstChar && CharOperation.prefixEquals(pattern, name, false)) { >+ return true; >+ } >+ break; >+ >+ case SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH: >+ return matchFirstChar && CharOperation.camelCaseMatch(pattern, name, true); >+ > case R_REGEXP_MATCH : > // TODO (frederic) implement regular expression match > return true; >@@ -2183,34 +2182,41 @@ > /** > * Validate compatibility between given string pattern and match rule. > *<br> >- * 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:<br> >- * => <b>pattern match flag is reset</b>, >- * </li> >- * <li>{@link #R_PATTERN_MATCH} and {@link #R_PREFIX_MATCH} flags >- * simultaneously set:<br> >- * => <b>prefix match flag is reset</b>, >+ * In certain circumstances described in the table below, the returned match rule is >+ * modified in order to provide a more efficient search pattern: >+ * <ol> >+ * <li>when regexp match flag is set (e.g. {@link #R_REGEXP_MATCH}),<br> >+ * then <b>the pattern is rejected</b> as this kind of match is not supported >+ * yet and <code>-1</code> is returned). > * </li> >- * <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>when the string pattern has <u>no</u> pattern characters (e.g. '*' or '?') and >+ * the pattern match flag is set (i.e. the match rule has the {@link #R_PATTERN_MATCH} >+ * flag),<br>then <b>the pattern match flag is reset</b>. Reversely, when >+ * the string pattern has pattern characters and the pattern match flag is >+ * <u>not</u> set,<br>then <b>the pattern match flag is set</b>. > * </li> >- * <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>when the pattern match flag is set with other match flags ({@link #R_PREFIX_MATCH}, >+ * {@link #R_CAMELCASE_MATCH} or {@link #R_CAMELCASE_SAME_PART_COUNT_MATCH}),<br> >+ * then <b>all these other match flags are reset</b>. > * </li> >- * <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>when the CamelCase match flag is set with other match flags ({@link #R_PREFIX_MATCH} >+ * or or {@link #R_CAMELCASE_SAME_PART_COUNT_MATCH}),<br> >+ * then <b>all these other match flags are reset</b>. If the string pattern cannot >+ * be a camel case pattern (see {@link #validateCamelCasePattern(String)}),<br> >+ * then <b>the CamelCase match is replaced with a prefix match flag</b>. > * </li> >- * </ul> >- *<br> >- * Rejected (i.e. returned match rule -1) combinations are: >- * <ul> >- * <li>{@link #R_REGEXP_MATCH} with any other match mode flag set, >+ * <li>when the CamelCase part count match flag is set with other match flags >+ * ({@link #R_PREFIX_MATCH}),<br> then <b>all these other match flags >+ * are reset</b>. If the string pattern cannot be a camel case pattern (see >+ * {@link #validateCamelCasePattern(String)}),<br> then <b>the CamelCase >+ * part count match is replaced with a prefix match flag</b>. > * </li> >- * </ul> >+ * </ol> >+ * <i>Note: the rules are validated in the documented order. For example, it means >+ * that as soon as the string pattern contains one pattern character, the pattern >+ * match flag will be set and all other match flags reset: validation of rule 2) >+ * followed by rule 3)...</i> >+ *<p> > * > * @param stringPattern The string pattern > * @param matchRule The match rule >@@ -2222,99 +2228,84 @@ > // Verify Regexp match rule > if ((matchRule & R_REGEXP_MATCH) != 0) { > if ((matchRule & R_PATTERN_MATCH) != 0 || (matchRule & R_PREFIX_MATCH) != 0 || >- (matchRule & R_CAMEL_CASE_MATCH) != 0 || (matchRule & R_CAMELCASE_MATCH) != 0) { >+ (matchRule & R_CAMELCASE_MATCH) != 0 || (matchRule & R_CAMELCASE_SAME_PART_COUNT_MATCH) != 0) { >+ // regexp is not supported yet > return -1; > } > } > > // Verify Pattern match rule >- int starIndex = stringPattern.indexOf('*'); >- int questionIndex = stringPattern.indexOf('?'); >- if (starIndex < 0 && questionIndex < 0) { >- // reset pattern match flag if any >- matchRule &= ~R_PATTERN_MATCH; >- } else { >- // force Pattern rule >- matchRule |= R_PATTERN_MATCH; >+ if (stringPattern != null) { >+ int starIndex = stringPattern.indexOf('*'); >+ int questionIndex = stringPattern.indexOf('?'); >+ if (starIndex < 0 && questionIndex < 0) { >+ // 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 flags if any >+ // reset other incompatible flags > matchRule &= ~R_CAMELCASE_MATCH; >- matchRule &= ~R_CAMEL_CASE_MATCH; >+ matchRule &= ~R_CAMELCASE_SAME_PART_COUNT_MATCH; > matchRule &= ~R_PREFIX_MATCH; >+ return matchRule; > } > >- // Verify Camel Case match rule >- 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; >- 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 >+ // Verify Camel Case >+ if ((matchRule & R_CAMELCASE_MATCH) != 0) { >+ // reset other incompatible flags >+ matchRule &= ~R_CAMELCASE_SAME_PART_COUNT_MATCH; >+ matchRule &= ~R_PREFIX_MATCH; >+ // validate camel case rule and modify it if not valid >+ boolean validCamelCase = validateCamelCasePattern(stringPattern); > if (!validCamelCase) { >- matchRule &= ~R_CAMEL_CASE_MATCH; >+ matchRule &= ~R_CAMELCASE_MATCH; > matchRule |= R_PREFIX_MATCH; > } >+ return matchRule; > } >- >- // 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) { >- // This is equivalent to Camel Case match rule >- matchRule &= ~R_PREFIX_MATCH; >- matchRule &= ~R_CASE_SENSITIVE; >- } >- } >- } else { >- matchRule &= ~R_CAMELCASE_MATCH; >- if ((matchRule & R_PREFIX_MATCH) == 0) { >- matchRule |= R_PREFIX_MATCH; >- matchRule |= R_CASE_SENSITIVE; >- } >+ >+ // Verify Camel Case with same count of parts >+ if ((matchRule & R_CAMELCASE_SAME_PART_COUNT_MATCH) != 0) { >+ // reset other incompatible flags >+ matchRule &= ~R_PREFIX_MATCH; >+ // validate camel case rule and modify it if not valid >+ boolean validCamelCase = validateCamelCasePattern(stringPattern); >+ if (!validCamelCase) { >+ matchRule &= ~R_CAMELCASE_SAME_PART_COUNT_MATCH; >+ matchRule |= R_PREFIX_MATCH; > } >+ return matchRule; > } >+ >+ // Return the validated match rule (modified if necessary) > return matchRule; > } > >-/** >- * Update deprecated 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; >- } >+/* >+ * Validate pattern for a camel case match rule >+ * @return >+ */ >+private static boolean validateCamelCasePattern(String stringPattern) { >+ if (stringPattern == null) return true; >+ // verify sting pattern validity >+ int length = stringPattern.length(); >+ boolean validCamelCase = true; >+ int uppercase = 0; >+ 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 (ScannerHelper.isUpperCase(ch)) uppercase++; > } >- return matchRule; >+ if (validCamelCase) { >+ validCamelCase = uppercase > 0; >+ } >+ return validCamelCase; > } > > /** >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.143 >diff -u -r1.143 SearchEngine.java >--- search/org/eclipse/jdt/core/search/SearchEngine.java 24 Aug 2007 05:59:05 -0000 1.143 >+++ search/org/eclipse/jdt/core/search/SearchEngine.java 1 Oct 2007 11:59:38 -0000 >@@ -565,12 +565,17 @@ > * May be <code>null</code>, then any type name is accepted. > * @param matchRule type name match rule one of > * <ul> >- * <li>{@link SearchPattern#R_EXACT_MATCH} if the package name and type name are the full names >- * of the searched types.</li> >- * <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_CAMEL_CASE_MATCH} if type name are camel case of the names of the searched types.</li> >+ * <li>{@link SearchPattern#R_EXACT_MATCH} if the package name and type >+ * name are the full names of the searched types.</li> >+ * <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 the type name is a >+ * camel case of the searched types name.</li> >+ * <li>{@link SearchPattern#R_CAMELCASE_SAME_PART_COUNT_MATCH} >+ * if the type name is a camel case with same part count of the searched >+ * types name.</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, >@@ -632,24 +637,34 @@ > * May be <code>null</code>, then any type name is accepted. > * @param packageMatchRule one of > * <ul> >- * <li>{@link SearchPattern#R_EXACT_MATCH} if the package name and type name are the full names >- * of the searched types.</li> >- * <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_CAMEL_CASE_MATCH} if type name are camel case of the names of the searched types.</li> >+ * <li>{@link SearchPattern#R_EXACT_MATCH} if the package name and type >+ * name are the full names of the searched types.</li> >+ * <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 the package name is a >+ * camel case of the searched types package name.</li> >+ * <li>{@link SearchPattern#R_CAMELCASE_SAME_PART_COUNT_MATCH} >+ * if the package name is a camel case with same part count of the searched >+ * types package name.</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, > * or {@link SearchPattern#R_PREFIX_MATCH} if a prefix non case sensitive match is requested. > * @param typeMatchRule one of > * <ul> >- * <li>{@link SearchPattern#R_EXACT_MATCH} if the package name and type name are the full names >- * of the searched types.</li> >- * <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_CAMEL_CASE_MATCH} if type name are camel case of the names of the searched types.</li> >+ * <li>{@link SearchPattern#R_EXACT_MATCH} if the package name and type >+ * name are the full names of the searched types.</li> >+ * <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 the type name is a >+ * camel case of the searched types name.</li> >+ * <li>{@link SearchPattern#R_CAMELCASE_SAME_PART_COUNT_MATCH} >+ * if the type name is a camel case with same part count of the searched >+ * types name.</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, >@@ -697,7 +712,7 @@ > this.basicEngine.searchAllTypeNames(packageName, > packageMatchRule, > typeName, >- SearchPattern.updateMatchRule(typeMatchRule), >+ typeMatchRule, > searchFor, > scope, > requestorWrapper, >@@ -719,12 +734,17 @@ > * May be <code>null</code>, then any package name is accepted. > * @param packageMatchRule one of > * <ul> >- * <li>{@link SearchPattern#R_EXACT_MATCH} if the package name and type name are the full names >- * of the searched types.</li> >- * <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_CAMEL_CASE_MATCH} if type name are camel case of the names of the searched types.</li> >+ * <li>{@link SearchPattern#R_EXACT_MATCH} if the package name and type >+ * name are the full names of the searched types.</li> >+ * <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 the package name is a >+ * camel case of the searched types package name.</li> >+ * <li>{@link SearchPattern#R_CAMELCASE_SAME_PART_COUNT_MATCH} >+ * if the package name is a camel case with same part count of the searched >+ * types package name.</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, >@@ -735,12 +755,17 @@ > * May be <code>null</code>, then any type name is accepted. > * @param typeMatchRule one of > * <ul> >- * <li>{@link SearchPattern#R_EXACT_MATCH} if the package name and type name are the full names >- * of the searched types.</li> >- * <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_CAMEL_CASE_MATCH} if type name are camel case of the names of the searched types.</li> >+ * <li>{@link SearchPattern#R_EXACT_MATCH} if the package name and type >+ * name are the full names of the searched types.</li> >+ * <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 the type name is a >+ * camel case of the searched types name.</li> >+ * <li>{@link SearchPattern#R_CAMELCASE_SAME_PART_COUNT_MATCH} >+ * if the type name is a camel case with same part count of the searched >+ * types name.</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, >@@ -789,7 +814,7 @@ > this.basicEngine.searchAllTypeNames(packageName, > packageMatchRule, > typeName, >- SearchPattern.updateMatchRule(typeMatchRule), >+ typeMatchRule, > searchFor, > scope, > requestorWrapper, >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.29 >diff -u -r1.29 Index.java >--- search/org/eclipse/jdt/internal/core/index/Index.java 24 Aug 2007 13:52:12 -0000 1.29 >+++ search/org/eclipse/jdt/internal/core/index/Index.java 1 Oct 2007 11:59:38 -0000 >@@ -47,7 +47,8 @@ > SearchPattern.R_PATTERN_MATCH | > SearchPattern.R_REGEXP_MATCH | > SearchPattern.R_CASE_SENSITIVE | >- SearchPattern.R_CAMEL_CASE_MATCH; >+ SearchPattern.R_CAMELCASE_MATCH | >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH; > > public static boolean isMatch(char[] pattern, char[] word, int matchRule) { > if (pattern == null) return true; >@@ -56,19 +57,7 @@ > if (patternLength == 0) return matchRule != SearchPattern.R_EXACT_MATCH; > 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_CAMEL_CASE_MATCH) != 0; >- if (isCamelCase) { >- // prefix is always needed as index key got characters after type simple name >- // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=201064 >- if (pattern[0] == word[0] && CharOperation.camelCaseMatch(pattern, word, true/*prefix match*/)) { >- return true; >- } >- if ((matchRule & SearchPattern.R_CASE_SENSITIVE) != 0) return false; >- } >- > // need to mask some bits of pattern rule (bug 79790) >- matchRule &= ~SearchPattern.R_CAMEL_CASE_MATCH; > switch(matchRule & MATCH_RULE_INDEX_MASK) { > case SearchPattern.R_EXACT_MATCH : > return patternLength == wordLength && CharOperation.equals(pattern, word, false); >@@ -76,12 +65,23 @@ > return patternLength <= wordLength && CharOperation.prefixEquals(pattern, word, false); > case SearchPattern.R_PATTERN_MATCH : > return CharOperation.match(pattern, word, false); >+ case SearchPattern.R_CAMELCASE_MATCH: >+ // same part count is not activated because index key may have uppercase letters after the type name >+ case SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH: >+ if (CharOperation.camelCaseMatch(pattern, word, false)) { >+ return true; >+ } >+ return patternLength <= wordLength && CharOperation.prefixEquals(pattern, word, false); > case SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE : > 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 : > return CharOperation.match(pattern, word, true); >+ case SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE : >+ // same part count is not activated because index key may have uppercase letters after the type name >+ case SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH | SearchPattern.R_CASE_SENSITIVE : >+ return (pattern[0] == word[0] && CharOperation.camelCaseMatch(pattern, word, false)); > } > return false; > } >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.69 >diff -u -r1.69 SearchableEnvironment.java >--- model/org/eclipse/jdt/internal/core/SearchableEnvironment.java 24 Aug 2007 05:59:06 -0000 1.69 >+++ model/org/eclipse/jdt/internal/core/SearchableEnvironment.java 1 Oct 2007 11:59:37 -0000 >@@ -380,7 +380,7 @@ > }; > try { > int matchRule = SearchPattern.R_PREFIX_MATCH; >- if (camelCaseMatch) matchRule |= SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH; >+ if (camelCaseMatch) matchRule |= SearchPattern.R_CAMELCASE_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.49 >diff -u -r1.49 BasicSearchEngine.java >--- search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java 28 Aug 2007 10:03:39 -0000 1.49 >+++ search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java 1 Oct 2007 11:59:38 -0000 >@@ -36,7 +36,7 @@ > /** > * Search basic engine. Public search engine (see {@link org.eclipse.jdt.core.search.SearchEngine} > * for detailed comment), now uses basic engine functionalities. >- * Note that serch basic engine does not implement deprecated functionalities... >+ * Note that search basic engine does not implement deprecated functionalities... > */ > public class BasicSearchEngine { > >@@ -271,11 +271,11 @@ > case SearchPattern.R_REGEXP_MATCH: > buffer.append("R_REGEXP_MATCH"); //$NON-NLS-1$ > break; >- case 0x0080: // SearchPattern.R_CAMELCASE_MATCH: >+ case 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$ >+ case SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH: >+ buffer.append("R_CAMELCASE_SAME_PART_COUNT_MATCH"); //$NON-NLS-1$ > break; > } > } >@@ -457,18 +457,12 @@ > return false; > > if (patternTypeName != null) { >- boolean isCamelCase = (matchRule & SearchPattern.R_CAMEL_CASE_MATCH) != 0; >+ boolean isCamelCase = (matchRule & (SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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) { >- 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 : > return matchFirstChar && CharOperation.equals(patternTypeName, typeName, isCaseSensitive); >@@ -479,6 +473,13 @@ > case SearchPattern.R_REGEXP_MATCH : > // TODO (frederic) implement regular expression match > break; >+ case SearchPattern.R_CAMELCASE_MATCH: >+ if (matchFirstChar && CharOperation.camelCaseMatch(patternTypeName, typeName, false)) { >+ return true; >+ } >+ return !isCaseSensitive && matchFirstChar && CharOperation.prefixEquals(patternTypeName, typeName, false); >+ case SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH: >+ return matchFirstChar && CharOperation.camelCaseMatch(patternTypeName, typeName, true); > } > } > return true; >@@ -645,15 +646,23 @@ > int waitingPolicy, > IProgressMonitor progressMonitor) throws JavaModelException { > >+ // Validate match rule first >+ final int validatedTypeMatchRule = SearchPattern.validateMatchRule(typeName == null ? null : new String (typeName), typeMatchRule); >+ >+ // Debug > if (VERBOSE) { > Util.verbose("BasicSearchEngine.searchAllTypeNames(char[], char[], int, int, IJavaSearchScope, IRestrictedAccessTypeRequestor, int, IProgressMonitor)"); //$NON-NLS-1$ > Util.verbose(" - package name: "+(packageName==null?"null":new String(packageName))); //$NON-NLS-1$ //$NON-NLS-2$ >- Util.verbose(" - match rule: "+getMatchRuleString(packageMatchRule)); //$NON-NLS-1$ >+ Util.verbose(" - package match rule: "+getMatchRuleString(packageMatchRule)); //$NON-NLS-1$ > Util.verbose(" - type name: "+(typeName==null?"null":new String(typeName))); //$NON-NLS-1$ //$NON-NLS-2$ >- Util.verbose(" - match rule: "+getMatchRuleString(typeMatchRule)); //$NON-NLS-1$ >+ Util.verbose(" - type match rule: "+getMatchRuleString(typeMatchRule)); //$NON-NLS-1$ >+ if (validatedTypeMatchRule != typeMatchRule) { >+ Util.verbose(" - validated type match rule: "+getMatchRuleString(validatedTypeMatchRule)); //$NON-NLS-1$ >+ } > Util.verbose(" - search for: "+searchFor); //$NON-NLS-1$ > Util.verbose(" - scope: "+scope); //$NON-NLS-1$ > } >+ if (validatedTypeMatchRule == -1) return; // invalid match rule => return no results > > // Create pattern > IndexManager indexManager = JavaModelManager.getIndexManager(); >@@ -690,13 +699,13 @@ > null, > typeName, > typeSuffix, >- typeMatchRule) >+ validatedTypeMatchRule) > : new QualifiedTypeDeclarationPattern( > packageName, > packageMatchRule, > typeName, > typeSuffix, >- typeMatchRule); >+ validatedTypeMatchRule); > > // Get working copy path(s). Store in a single string in case of only one to optimize comparison in requestor > final HashSet workingCopyPaths = new HashSet(); >@@ -728,7 +737,7 @@ > break; > case 1: > if (singleWkcpPath.equals(documentPath)) { >- return true; // fliter out *the* working copy >+ return true; // filter out *the* working copy > } > break; > default: >@@ -813,7 +822,7 @@ > } else /*if (type.isInterface())*/ { > kind = TypeDeclaration.INTERFACE_DECL; > } >- if (match(typeSuffix, packageName, typeName, typeMatchRule, kind, packageDeclaration, simpleName)) { >+ if (match(typeSuffix, packageName, typeName, validatedTypeMatchRule, kind, packageDeclaration, simpleName)) { > if (nameRequestor instanceof TypeNameMatchRequestorWrapper) { > ((TypeNameMatchRequestorWrapper)nameRequestor).requestor.acceptTypeNameMatch(new JavaSearchTypeNameMatch(type, type.getFlags())); > } else { >@@ -833,7 +842,7 @@ > return false; // no local/anonymous type > } > public boolean visit(TypeDeclaration typeDeclaration, CompilationUnitScope compilationUnitScope) { >- if (match(typeSuffix, packageName, typeName, typeMatchRule, TypeDeclaration.kind(typeDeclaration.modifiers), packageDeclaration, typeDeclaration.name)) { >+ if (match(typeSuffix, packageName, typeName, validatedTypeMatchRule, TypeDeclaration.kind(typeDeclaration.modifiers), packageDeclaration, typeDeclaration.name)) { > if (nameRequestor instanceof TypeNameMatchRequestorWrapper) { > IType type = workingCopy.getType(new String(typeName)); > ((TypeNameMatchRequestorWrapper)nameRequestor).requestor.acceptTypeNameMatch(new JavaSearchTypeNameMatch(type, typeDeclaration.modifiers)); >@@ -844,7 +853,7 @@ > return true; > } > public boolean visit(TypeDeclaration memberTypeDeclaration, ClassScope classScope) { >- if (match(typeSuffix, packageName, typeName, typeMatchRule, TypeDeclaration.kind(memberTypeDeclaration.modifiers), packageDeclaration, memberTypeDeclaration.name)) { >+ if (match(typeSuffix, packageName, typeName, validatedTypeMatchRule, TypeDeclaration.kind(memberTypeDeclaration.modifiers), packageDeclaration, memberTypeDeclaration.name)) { > // compute enclosing type names > TypeDeclaration enclosing = memberTypeDeclaration.enclosingType; > char[][] enclosingTypeNames = CharOperation.NO_CHAR_CHAR; >@@ -892,23 +901,35 @@ > public void searchAllTypeNames( > final char[][] qualifications, > final char[][] typeNames, >- final int matchRule, >+ int matchRule, > int searchFor, > IJavaSearchScope scope, > final IRestrictedAccessTypeRequestor nameRequestor, > int waitingPolicy, > IProgressMonitor progressMonitor) throws JavaModelException { > >+ // Validate match rule first >+ int namesLength = typeNames == null ? 0 : typeNames.length; >+ for (int i=0; i<namesLength; i++) { >+ matchRule &= SearchPattern.validateMatchRule(new String(typeNames[i]), matchRule); >+ } >+ final int validatedMatchRule = matchRule; >+ >+ // Debug > if (VERBOSE) { > Util.verbose("BasicSearchEngine.searchAllTypeNames(char[][], char[][], int, int, IJavaSearchScope, IRestrictedAccessTypeRequestor, int, IProgressMonitor)"); //$NON-NLS-1$ > Util.verbose(" - package name: "+(qualifications==null?"null":new String(CharOperation.concatWith(qualifications, ',')))); //$NON-NLS-1$ //$NON-NLS-2$ > Util.verbose(" - type name: "+(typeNames==null?"null":new String(CharOperation.concatWith(typeNames, ',')))); //$NON-NLS-1$ //$NON-NLS-2$ > Util.verbose(" - match rule: "+matchRule); //$NON-NLS-1$ >+ if (validatedMatchRule != matchRule) { >+ Util.verbose(" - validated match rule: "+getMatchRuleString(validatedMatchRule)); //$NON-NLS-1$ >+ } > Util.verbose(" - search for: "+searchFor); //$NON-NLS-1$ > Util.verbose(" - scope: "+scope); //$NON-NLS-1$ > } > IndexManager indexManager = JavaModelManager.getIndexManager(); > >+ // Create pattern > final char typeSuffix; > switch(searchFor){ > case IJavaSearchConstants.CLASS : >@@ -936,7 +957,7 @@ > typeSuffix = IIndexConstants.TYPE_SUFFIX; > break; > } >- final MultiTypeDeclarationPattern pattern = new MultiTypeDeclarationPattern(qualifications, typeNames, typeSuffix, matchRule); >+ final MultiTypeDeclarationPattern pattern = new MultiTypeDeclarationPattern(qualifications, typeNames, typeSuffix, validatedMatchRule); > > // Get working copy path(s). Store in a single string in case of only one to optimize comparison in requestor > final HashSet workingCopyPaths = new HashSet(); >@@ -968,7 +989,7 @@ > break; > case 1: > if (singleWkcpPath.equals(documentPath)) { >- return true; // fliter out *the* working copy >+ return true; // filter out *the* working copy > } > break; > default: >@@ -1071,14 +1092,14 @@ > } > public boolean visit(TypeDeclaration typeDeclaration, CompilationUnitScope compilationUnitScope) { > SearchPattern decodedPattern = >- new QualifiedTypeDeclarationPattern(packageDeclaration, typeDeclaration.name, convertTypeKind(TypeDeclaration.kind(typeDeclaration.modifiers)), matchRule); >+ new QualifiedTypeDeclarationPattern(packageDeclaration, typeDeclaration.name, convertTypeKind(TypeDeclaration.kind(typeDeclaration.modifiers)), validatedMatchRule); > if (pattern.matchesDecodedKey(decodedPattern)) { > nameRequestor.acceptType(typeDeclaration.modifiers, packageDeclaration, typeDeclaration.name, CharOperation.NO_CHAR_CHAR, path, null); > } > return true; > } > public boolean visit(TypeDeclaration memberTypeDeclaration, ClassScope classScope) { >- // compute encloising type names >+ // compute enclosing type names > char[] qualification = packageDeclaration; > TypeDeclaration enclosing = memberTypeDeclaration.enclosingType; > char[][] enclosingTypeNames = CharOperation.NO_CHAR_CHAR; >@@ -1092,7 +1113,7 @@ > } > } > SearchPattern decodedPattern = >- new QualifiedTypeDeclarationPattern(qualification, memberTypeDeclaration.name, convertTypeKind(TypeDeclaration.kind(memberTypeDeclaration.modifiers)), matchRule); >+ new QualifiedTypeDeclarationPattern(qualification, memberTypeDeclaration.name, convertTypeKind(TypeDeclaration.kind(memberTypeDeclaration.modifiers)), validatedMatchRule); > if (pattern.matchesDecodedKey(decodedPattern)) { > nameRequestor.acceptType(memberTypeDeclaration.modifiers, packageDeclaration, memberTypeDeclaration.name, enclosingTypeNames, path, null); > } >#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.166 >diff -u -r1.166 JavaSearchTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java 24 Aug 2007 05:58:27 -0000 1.166 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java 1 Oct 2007 11:59:45 -0000 >@@ -3715,85 +3715,50 @@ > * > * 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 { >+public void testCamelCaseTypePattern01_CamelCase() throws CoreException { > 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 { >+public void testCamelCaseTypePattern02_CamelCase() throws CoreException { > search("RException", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( > ""+ getExternalJCLPathString() + " java.lang.RuntimeException" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testCamelCaseTypePattern03() throws CoreException { >+public void testCamelCaseTypePattern03_CamelCase() throws CoreException { > search("RuntimeException", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( > ""+ getExternalJCLPathString() + " java.lang.RuntimeException" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testCamelCaseTypePattern04() throws CoreException { >+public void testCamelCaseTypePattern04_CamelCase() throws CoreException { > search("RUNTIMEEXCEPTION", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( > ""+ getExternalJCLPathString() + " java.lang.RuntimeException" > ); > } >-/** >- * @deprecated As using a depreciated constant >- */ >-public void testCamelCaseTypePattern05() throws CoreException { >+public void testCamelCaseTypePattern05_CamelCase() throws CoreException { > 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 { >+public void testCamelCaseTypePattern06_CamelCase() throws CoreException { > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine().searchAllTypeNames( >- null, >- SearchPattern.R_EXACT_MATCH, >- "CNS".toCharArray(), >- SearchPattern.R_CAMELCASE_MATCH, >- TYPE, >- getJavaSearchScope(), >- requestor, >- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >- null >- ); >+ searchAllTypeNames("CNS", SearchPattern.R_CAMELCASE_MATCH, requestor); > assertSearchResults( > "Unexpected all type names", > "java.lang.CloneNotSupportedException", > requestor); > } >-/** @deprecated As using a depreciated constant */ >-public void testCamelCaseTypePattern07() throws CoreException { >+public void testCamelCaseTypePattern07_CamelCase() throws CoreException { > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine().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", > "AA\n" + >@@ -3803,20 +3768,9 @@ > "q1.AA", > requestor); > } >-/** @deprecated As using a depreciated constant */ >-public void testCamelCaseTypePattern08() throws CoreException { >+public void testCamelCaseTypePattern08_CamelCase() throws CoreException { > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine().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", > "AA\n" + >@@ -3825,20 +3779,9 @@ > "q1.AA", > requestor); > } >-/** @deprecated As using a depreciated constant */ >-public void testCamelCaseTypePattern09() throws CoreException { >+public void testCamelCaseTypePattern09_CamelCase() throws CoreException { > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- new SearchEngine().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_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH, requestor); > assertSearchResults( > "Unexpected all type names", > "AA\n" + >@@ -3847,13 +3790,13 @@ > "q1.AA", > requestor); > } >-/** @deprecated As using a depreciated constant */ >-public void testCamelCaseTypePattern10() throws CoreException { >+public void testCamelCaseTypePattern10_CamelCase() 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" + > "class NULLPOINTEREXCEPTION {}\n" >@@ -3863,18 +3806,19 @@ > "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]\n" + > "src/Test.java NULLPOINTEREXCEPTION [NULLPOINTEREXCEPTION]" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testCamelCaseTypePattern11() throws CoreException { >+public void testCamelCaseTypePattern11_CamelCase() 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" + > "class NULLPOINTEREXCEPTION {}\n" >@@ -3884,34 +3828,37 @@ > "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]\n" + > "src/Test.java NULLPOINTEREXCEPTION [NULLPOINTEREXCEPTION]" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testCamelCaseTypePattern12() throws CoreException { >+public void testCamelCaseTypePattern12_CamelCase() 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" + > "class NULLPOINTEREXCEPTION {}\n" > ); > search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE); > assertSearchResults( >- "src/Test.java Null [Null]" >+ "src/Test.java Null [Null]\n" + >+ "src/Test.java NullPointerException [NullPointerException]\n" + >+ "src/Test.java Nullpointerexception [Nullpointerexception]" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testCamelCaseTypePattern13() throws CoreException { >+public void testCamelCaseTypePattern13_CamelCase() 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" + > "class NULLPOINTEREXCEPTION {}\n" >@@ -3919,78 +3866,147 @@ > 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]" >+ "src/Test.java NullPointerException [NullPointerException]\n" + >+ "src/Test.java Nullpointerexception [Nullpointerexception]" >+ ); >+} >+// Same tests using SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH instead >+public void testCamelCaseTypePattern01_CamelCaseSamePartCount() throws CoreException { >+ search("RE", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults( >+ ""+ getExternalJCLPathString() + " java.lang.RuntimeException" >+ ); >+} >+public void testCamelCaseTypePattern02_CamelCaseSamePartCount() throws CoreException { >+ search("RException", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults( >+ ""+ getExternalJCLPathString() + " java.lang.RuntimeException" >+ ); >+} >+public void testCamelCaseTypePattern03_CamelCaseSamePartCount() throws CoreException { >+ search("RuntimeException", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults( >+ ""+ getExternalJCLPathString() + " java.lang.RuntimeException" >+ ); >+} >+public void testCamelCaseTypePattern04_CamelCaseSamePartCount() throws CoreException { >+ search("RUNTIMEEXCEPTION", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults(""); >+} >+public void testCamelCaseTypePattern05_CamelCaseSamePartCount() throws CoreException { >+ search("R*E*", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults( >+ "src/a3/References.java a3.References [References]\n" + >+ ""+ getExternalJCLPathString() + " java.lang.RuntimeException" > ); > } >-public void testCamelCaseTypePattern14() throws CoreException { >+public void testCamelCaseTypePattern06_CamelCaseSamePartCount() throws CoreException { >+ TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >+ searchAllTypeNames("CNS", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, requestor); >+ assertSearchResults( >+ "Unexpected all type names", >+ "", >+ requestor); >+} >+public void testCamelCaseTypePattern07_CamelCaseSamePartCount() throws CoreException { >+ TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >+ searchAllTypeNames("AA", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, requestor); >+ assertSearchResults( >+ "Unexpected all type names", >+ "AA\n" + >+ "d8.AA\n" + >+ "p6.AA\n" + >+ "q1.AA", >+ requestor); >+} >+public void testCamelCaseTypePattern08_CamelCaseSamePartCount() throws CoreException { >+ TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >+ searchAllTypeNames("aa", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, requestor); >+ assertSearchResults( >+ "Unexpected all type names", >+ "AA\n" + >+ "d8.AA\n" + >+ "p6.AA\n" + >+ "q1.AA", >+ requestor); >+} >+public void testCamelCaseTypePattern09_CamelCaseSamePartCount() throws CoreException { >+ TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >+ searchAllTypeNames("aa", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH | SearchPattern.R_PREFIX_MATCH, requestor); >+ assertSearchResults( >+ "Unexpected all type names", >+ "AA\n" + >+ "d8.AA\n" + >+ "p6.AA\n" + >+ "q1.AA", >+ requestor); >+} >+public void testCamelCaseTypePattern10_CamelCaseSamePartCount() 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" + > "class NULLPOINTEREXCEPTION {}\n" > ); >- search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > assertSearchResults( > "src/Test.java Null [Null]\n" + >- "src/Test.java NULL [NULL]" >+ "src/Test.java Nullpointerexception [Nullpointerexception]" > ); > } >-public void testCamelCaseTypePattern15() throws CoreException { >+public void testCamelCaseTypePattern11_CamelCaseSamePartCount() 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" + > "class NULLPOINTEREXCEPTION {}\n" > ); >- search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH); >+ search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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]" >+ "src/Test.java Nullpointerexception [Nullpointerexception]" > ); > } >-public void testCamelCaseTypePattern16() throws CoreException { >+public void testCamelCaseTypePattern12_CamelCaseSamePartCount() 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" + > "class NULLPOINTEREXCEPTION {}\n" > ); >- search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH | SearchPattern.R_CASE_SENSITIVE); > assertSearchResults( >- "src/Test.java Null [Null]" >+ "src/Test.java Null [Null]\n" + >+ "src/Test.java Nullpointerexception [Nullpointerexception]" > ); > } >-public void testCamelCaseTypePattern17() throws CoreException { >+public void testCamelCaseTypePattern13_CamelCaseSamePartCount() 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" + > "class NULLPOINTEREXCEPTION {}\n" > ); >- search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ search("Null", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE); > assertSearchResults( > "src/Test.java Null [Null]\n" + >- "src/Test.java NullPointerException [NullPointerException]" >+ "src/Test.java Nullpointerexception [Nullpointerexception]" > ); > } > >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.123 >diff -u -r1.123 JavaSearchBugsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 28 Sep 2007 11:51:21 -0000 1.123 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 1 Oct 2007 11:59:44 -0000 >@@ -4719,7 +4719,7 @@ > "interface IDocumentExtension315 {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("IDE3", SearchPattern.R_CAMEL_CASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("IDE3", SearchPattern.R_CAMELCASE_MATCH); > searchAllTypeNames("IDE3", validatedRule, requestor); > assertSearchResults( > "IDocumentExtension135\n" + >@@ -4740,7 +4740,7 @@ > "interface IDocumentProviderExtension54321 {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("IDPE3", SearchPattern.R_CAMEL_CASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("IDPE3", SearchPattern.R_CAMELCASE_MATCH); > searchAllTypeNames("IDPE3", validatedRule, requestor); > assertSearchResults( > "IDocumentProviderExtension12345\n" + >@@ -4757,7 +4757,7 @@ > "interface IPerspectiveListener3 {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("IPL3", SearchPattern.R_CAMEL_CASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("IPL3", SearchPattern.R_CAMELCASE_MATCH); > searchAllTypeNames("IPL3", validatedRule, requestor); > assertSearchResults( > "IPerspectiveListener3", >@@ -4771,7 +4771,7 @@ > "interface IPropertySource2 {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("IPS2", SearchPattern.R_CAMEL_CASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("IPS2", SearchPattern.R_CAMELCASE_MATCH); > searchAllTypeNames("IPS2", validatedRule, requestor); > assertSearchResults( > "IPropertySource2", >@@ -4788,7 +4788,7 @@ > "interface IWorkbenchWindowPulldownDelegate4 {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("IWWPD2", SearchPattern.R_CAMEL_CASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("IWWPD2", SearchPattern.R_CAMELCASE_MATCH); > searchAllTypeNames("IWWPD2", validatedRule, requestor); > assertSearchResults( > "IWorkbenchWindowPulldownDelegate2", >@@ -4804,7 +4804,7 @@ > "class UTFDocScannerSupport {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("UTF16DSS", SearchPattern.R_CAMEL_CASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("UTF16DSS", SearchPattern.R_CAMELCASE_MATCH); > searchAllTypeNames("UTF16DSS", validatedRule, requestor); > assertSearchResults( > "UTF16DocumentScannerSupport", >@@ -4820,7 +4820,7 @@ > "class UTFDocScannerSupport {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("UTF1DSS", SearchPattern.R_CAMEL_CASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("UTF1DSS", SearchPattern.R_CAMELCASE_MATCH); > searchAllTypeNames("UTF1DSS", validatedRule, requestor); > assertSearchResults( > "UTF16DocumentScannerSupport\n" + >@@ -4837,7 +4837,7 @@ > "class UTFDocScannerSupport {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("UTF6DSS", SearchPattern.R_CAMEL_CASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("UTF6DSS", SearchPattern.R_CAMELCASE_MATCH); > searchAllTypeNames("UTF6DSS", validatedRule, requestor); > assertSearchResults( > "UTF16DocumentScannerSupport\n" + >@@ -4854,7 +4854,7 @@ > "class UTFDocScannerSupport {}\n" > ); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- int validatedRule = SearchPattern.validateMatchRule("UTFDSS", SearchPattern.R_CAMEL_CASE_MATCH); >+ int validatedRule = SearchPattern.validateMatchRule("UTFDSS", SearchPattern.R_CAMELCASE_MATCH); > searchAllTypeNames("UTFDSS", validatedRule, requestor); > assertSearchResults( > "UTF16DocumentScannerSupport\n" + >@@ -4893,7 +4893,6 @@ > "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); >@@ -4906,9 +4905,9 @@ > "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH" > ); > } >-public void testBug110060_TypePattern01new() throws CoreException { >+public void testBug110060_TypePattern01_SamePartCount() throws CoreException { > setUpBug110060_TypePattern(); >- search("AA", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("AA", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > assertSearchResults( > "src/b110060/Test.java b110060.Test.a2 [AAa] EXACT_MATCH\n" + > "src/b110060/Test.java b110060.Test.a4 [AAxx] EXACT_MATCH\n" + >@@ -4916,7 +4915,6 @@ > "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); >@@ -4935,9 +4933,9 @@ > "src/b110060/Test.java b110060.AxxAyy [AxxAyy] EXACT_MATCH" > ); > } >-public void testBug110060_TypePattern02new() throws CoreException { >+public void testBug110060_TypePattern02_SamePartCount() throws CoreException { > setUpBug110060_TypePattern(); >- search("AA", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("AA", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > assertSearchResults( > "src/b110060/Test.java b110060.Test.a2 [AAa] EXACT_MATCH\n" + > "src/b110060/Test.java b110060.Test.a4 [AAxx] EXACT_MATCH\n" + >@@ -4949,7 +4947,6 @@ > "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, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -4957,14 +4954,13 @@ > "src/b110060/Test.java b110060.Test.a4 [AAxx] EXACT_MATCH" > ); > } >-public void testBug110060_TypePattern03new() throws CoreException { >+public void testBug110060_TypePattern03_SamePartCount() throws CoreException { > setUpBug110060_TypePattern(); >- search("AAx", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("AAx", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > assertSearchResults( >- "" // no result as camel case does not allow prefix match >+ "src/b110060/Test.java b110060.Test.a4 [AAxx] EXACT_MATCH" > ); > } >-/** @deprecated As using a depreciated constant */ > public void testBug110060_TypePattern04() throws CoreException { > setUpBug110060_TypePattern(); > search("Axx", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -4972,14 +4968,11 @@ > "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH" > ); > } >-public void testBug110060_TypePattern04new() throws CoreException { >+public void testBug110060_TypePattern04_SamePartCount() throws CoreException { > setUpBug110060_TypePattern(); >- search("Axx", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >- assertSearchResults( >- "" // no result as camel case does not allow prefix match >- ); >+ search("Axx", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults(""); > } >-/** @deprecated As using a depreciated constant */ > public void testBug110060_TypePattern05() throws CoreException { > setUpBug110060_TypePattern(); > search("Ax", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -4988,17 +4981,15 @@ > "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH" > ); > } >-public void testBug110060_TypePattern05new() throws CoreException { >+public void testBug110060_TypePattern05_SamePartCount() 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 >- ); >+ search("Ax", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults(""); > } >-/** @deprecated As using a depreciated constant */ > public void testBug110060_TypePattern06() throws CoreException { > setUpBug110060_TypePattern(); > search("A*A*", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); >+ // Invalid camel case pattern => replace the camel case flag with pattern match one (case insensitive) > assertSearchResults( > "src/b110060/Test.java b110060.Test.a1 [Aaa] EXACT_MATCH\n" + > "src/b110060/Test.java b110060.Test.a2 [AAa] EXACT_MATCH\n" + >@@ -5008,9 +4999,10 @@ > "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH" > ); > } >-public void testBug110060_TypePattern06new() throws CoreException { >+public void testBug110060_TypePattern06_SamePartCount() throws CoreException { > setUpBug110060_TypePattern(); >- search("A*A*", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("A*A*", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ // Invalid camel case pattern => replace the camel case flag with pattern match one (case insensitive) > assertSearchResults( > "src/b110060/Test.java b110060.Test.a1 [Aaa] EXACT_MATCH\n" + > "src/b110060/Test.java b110060.Test.a2 [AAa] EXACT_MATCH\n" + >@@ -5020,58 +5012,66 @@ > "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, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); >+ search("aaa", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); >+ // Invalid camel case pattern => replace the camel case flag by prefix match one (case insensitive) > assertSearchResults( >- "" // no result because it's an invalid camel case pattern which is replaced with >- // prefix case sensitive match bu SearchPatter.validateMatchRule(...) (old behavior) >+ "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" > ); > } >-public void testBug110060_TypePattern07new() throws CoreException { >+public void testBug110060_TypePattern07_SamePartCount() throws CoreException { > setUpBug110060_TypePattern(); >- search("aa", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >- // Not a valid camel case pattern => changed to prefix >+ search("aaa", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ // Invalid camel case pattern => replace the camel case flag by prefix match one (case insensitive) > 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" >+ "src/b110060/Test.java b110060.Test.a3 [AaAaAa] EXACT_MATCH" > ); > } > public void testBug110060_TypePattern08() throws CoreException { > setUpBug110060_TypePattern(); >- search("aa", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH); >+ search("Aaa", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_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" >+ "src/b110060/Test.java b110060.Test.a3 [AaAaAa] EXACT_MATCH" >+ ); >+} >+public void testBug110060_TypePattern08_SamePartCount() throws CoreException { >+ setUpBug110060_TypePattern(); >+ search("Aaa", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults( >+ "src/b110060/Test.java b110060.Test.a1 [Aaa] EXACT_MATCH" > ); > } > public void testBug110060_TypePattern09() throws CoreException { > setUpBug110060_TypePattern(); >- search("AA", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ search("Aaa", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE); > 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" >+ "src/b110060/Test.java b110060.Test.a1 [Aaa] EXACT_MATCH" >+ ); >+} >+public void testBug110060_TypePattern09_SamePartCount() throws CoreException { >+ setUpBug110060_TypePattern(); >+ search("Aaa", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ assertSearchResults( >+ "src/b110060/Test.java b110060.Test.a1 [Aaa] EXACT_MATCH" > ); > } >-/** @deprecated As using a depreciated constant */ > public void testBug110060_TypePattern10() throws CoreException { > setUpBug110060_TypePattern(); > search("AxAx", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults(""); > } >-public void testBug110060_TypePattern10new() throws CoreException { >+public void testBug110060_TypePattern10_SamePartCount() throws CoreException { > setUpBug110060_TypePattern(); >- search("AxAx", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("AxAx", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > assertSearchResults(""); > } >-/** @deprecated As using a depreciated constant */ > public void testBug110060_TypePattern11() throws CoreException { > setUpBug110060_TypePattern(); > search("AxxA", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -5079,14 +5079,13 @@ > "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH" > ); > } >-public void testBug110060_TypePattern11new() throws CoreException { >+public void testBug110060_TypePattern11_SamePartCount() throws CoreException { > setUpBug110060_TypePattern(); >- search("AxxA", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("AxxA", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -5094,20 +5093,18 @@ > "src/b110060/Test.java b110060.Test.a6 [AxxAyy] EXACT_MATCH" > ); > } >-public void testBug110060_TypePattern12new() throws CoreException { >+public void testBug110060_TypePattern12_SamePartCount() throws CoreException { > setUpBug110060_TypePattern(); >- search("AxXA", TYPE, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("AxXA", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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(); > searchAllTypeNames("AA", SearchPattern.R_CAMELCASE_MATCH, requestor); >- assertSearchResults( >- "Unexpected all type names", >+ assertSearchResults("Unexpected all type names", > "b110060.AAa\n" + > "b110060.AAxx\n" + > "b110060.AaAaAa\n" + >@@ -5116,12 +5113,11 @@ > "b110060.AxxAyy", > requestor); > } >-public void testBug110060_AllTypeNames01new() throws CoreException { >+public void testBug110060_AllTypeNames01_SamePartCount() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- searchAllTypeNames("AA", SearchPattern.R_CAMEL_CASE_MATCH, requestor); >- assertSearchResults( >- "Unexpected all type names", >+ searchAllTypeNames("AA", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, requestor); >+ assertSearchResults("Unexpected all type names", > "b110060.AAa\n" + > "b110060.AAxx\n" + > "b110060.AxA\n" + >@@ -5131,40 +5127,43 @@ > public void testBug110060_AllTypeNames02() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- searchAllTypeNames("AA", SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH, requestor); >- assertSearchResults( >- "Unexpected all type names", >+ searchAllTypeNames("aaa", SearchPattern.R_CAMELCASE_MATCH, requestor); >+ // Invalid camel case pattern => replace the camel case flag with prefix match one (case insensitive) >+ assertSearchResults("Unexpected all type names", > "b110060.AAa\n" + >- "b110060.AAxx\n" + > "b110060.AaAaAa\n" + >- "b110060.Aaa\n" + >- "b110060.AxA\n" + >- "b110060.AxxAyy", >+ "b110060.Aaa", >+ requestor); >+} >+public void testBug110060_AllTypeNames02_SamePartCount() throws CoreException { >+ setUpBug110060_TypePattern(); >+ TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >+ searchAllTypeNames("aaa", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, requestor); >+ // Invalid camel case pattern => replace the camel case flag with prefix match one (case insensitive) >+ assertSearchResults("Unexpected all type names", >+ "b110060.AAa\n" + >+ "b110060.AaAaAa\n" + >+ "b110060.Aaa", > requestor); > } > public void testBug110060_AllTypeNames03() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- searchAllTypeNames("AAA", SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); >- assertSearchResults( >- "Unexpected all type names", >+ searchAllTypeNames("AAa", SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); >+ assertSearchResults("Unexpected all type names", >+ "b110060.AAa\n" + > "b110060.AaAaAa", > requestor); > } >-public void testBug110060_AllTypeNames04() throws CoreException { >+public void testBug110060_AllTypeNames03_SamePartCount() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- searchAllTypeNames("AA", SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); >- assertSearchResults( >- "Unexpected all type names", >- "b110060.AAa\n" + >- "b110060.AAxx\n" + >- "b110060.AaAaAa\n" + >- "b110060.AxA\n" + >- "b110060.AxxAyy", >+ searchAllTypeNames("AAa", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); >+ assertSearchResults("Unexpected all type names", >+ "b110060.AAa", > requestor); > } >-public void testBug110060_AllTypeNames05() throws CoreException { >+public void testBug110060_AllTypeNames04() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); > searchAllTypeNames("AA", SearchPattern.R_PREFIX_MATCH, requestor); >@@ -5176,7 +5175,7 @@ > "b110060.Aaa", > requestor); > } >-public void testBug110060_AllTypeNames06() throws CoreException { >+public void testBug110060_AllTypeNames05() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); > searchAllTypeNames("AAA", SearchPattern.R_CASE_SENSITIVE, requestor); >@@ -5185,7 +5184,7 @@ > "", > requestor); > } >-public void testBug110060_AllTypeNames07() throws CoreException { >+public void testBug110060_AllTypeNames06() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); > searchAllTypeNames("AA", SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); >@@ -5195,53 +5194,65 @@ > "b110060.AAxx", > requestor); > } >-/** @deprecated As using a depreciated constant */ >-public void testBug110060_AllTypeNames08() throws CoreException { >+public void testBug110060_AllTypeNames07() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- searchAllTypeNames("aa", SearchPattern.R_CAMELCASE_MATCH, requestor); >+ searchAllTypeNames("aaa", SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH, requestor); >+ // Invalid camel case pattern => replace the camel case flag with prefix match one (case insensitive) > assertSearchResults( > "Unexpected all type names", > "b110060.AAa\n" + >- "b110060.AAxx\n" + > "b110060.AaAaAa\n" + > "b110060.Aaa", > requestor); > } >-public void testBug110060_AllTypeNames08new() throws CoreException { >+public void testBug110060_AllTypeNames07_SamePartCount() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- searchAllTypeNames("aa", SearchPattern.R_CAMEL_CASE_MATCH, requestor); >+ searchAllTypeNames("aaa", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH | SearchPattern.R_PREFIX_MATCH, requestor); >+ // Invalid camel case pattern => replace the camel case flag with prefix match one (case insensitive) > assertSearchResults( > "Unexpected all type names", >- "", // no match as pattern is not a valid camel case >+ "b110060.AAa\n" + >+ "b110060.AaAaAa\n" + >+ "b110060.Aaa", > requestor); > } >-public void testBug110060_AllTypeNames09() throws CoreException { >+public void testBug110060_AllTypeNames08() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- searchAllTypeNames("aa", SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH, requestor); >+ searchAllTypeNames("aaa", SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); >+ // Invalid camel case pattern => replace the camel case flag with prefix match one keeping case sensitive > assertSearchResults( > "Unexpected all type names", >- "b110060.AAa\n" + >- "b110060.AAxx\n" + >- "b110060.AaAaAa\n" + >- "b110060.Aaa", >+ "", >+ requestor); >+} >+public void testBug110060_AllTypeNames08_SamePartCount() throws CoreException { >+ setUpBug110060_TypePattern(); >+ TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >+ searchAllTypeNames("aaa", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); >+ // Invalid camel case pattern => replace the camel case flag with prefix match one keeping case sensitive >+ assertSearchResults( >+ "Unexpected all type names", >+ "", > requestor); > } >-public void testBug110060_AllTypeNames10() throws CoreException { >+public void testBug110060_AllTypeNames09() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- searchAllTypeNames("aa", SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); >+ searchAllTypeNames("aaa", SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); >+ // Invalid camel case pattern => reset the camel case flag keeping prefix match and case sensitive ones > assertSearchResults( > "Unexpected all type names", >- "", // no match as pattern is not a valid camel case >+ "", > requestor); > } >-public void testBug110060_AllTypeNames11() throws CoreException { >+public void testBug110060_AllTypeNames09_SamePartCount() throws CoreException { > setUpBug110060_TypePattern(); > TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); >- searchAllTypeNames("aa", SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); >+ searchAllTypeNames("aaa", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, requestor); >+ // Invalid camel case pattern => reset the camel case flag keeping prefix match and case sensitive ones > assertSearchResults( > "Unexpected all type names", > "", >@@ -5281,10 +5292,10 @@ > // Constructor search > private void setUpBug110060_ConstructorPattern() throws CoreException { > workingCopies = new ICompilationUnit[5]; >- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110060/AA.java", >+ workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110060/AAAA.java", > "package b110060;\n" + >- "public class AA {\n" + >- " AA() {}\n" + >+ "public class AAAA {\n" + >+ " AAAA() {}\n" + > "}\n" > ); > workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b110060/AAxx.java", >@@ -5299,78 +5310,125 @@ > " AxxAyy() {}\n" + > "}\n" > ); >- workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/b110060/AxA.java", >+ workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/b110060/AxAyAz.java", > "package b110060;\n" + >- "public class AxA {\n" + >- " AxA() {}\n" + >+ "public class AxAyAz {\n" + >+ " AxAyAz() {}\n" + > "}\n" > ); > workingCopies[4] = getWorkingCopy("/JavaSearchBugs/src/b110060/Test.java", > "package b110060;\n" + > "public class Test {\n" + >- " AA aa = new AA();\n" + >+ " AAAA aaaa = new AAAA();\n" + > " AAxx aaxx = new AAxx();\n" + >- " AxA axa = new AxA();\n" + >+ " AxAyAz axayaz = new AxAyAz();\n" + > " AxxAyy axxayy = new AxxAyy();\n" + > "}\n" > ); > } > public void testBug110060_ConstructorPattern01() throws CoreException { > setUpBug110060_ConstructorPattern(); >- search("AA", CONSTRUCTOR, REFERENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("AA", CONSTRUCTOR, REFERENCES, SearchPattern.R_CAMELCASE_MATCH); >+ assertSearchResults( >+ "src/b110060/Test.java b110060.Test.aaaa [new AAAA()] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.aaxx [new AAxx()] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.axayaz [new AxAyAz()] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.axxayy [new AxxAyy()] EXACT_MATCH" >+ ); >+} >+public void testBug110060_ConstructorPattern01_SamePartCount() throws CoreException { >+ setUpBug110060_ConstructorPattern(); >+ search("AA", CONSTRUCTOR, REFERENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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" + >- "src/b110060/Test.java b110060.Test.axa [new AxA()] EXACT_MATCH\n" + > "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_CAMEL_CASE_MATCH); >+ search("AA", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( >- "src/b110060/AA.java b110060.AA() [AA] EXACT_MATCH\n" + >+ "src/b110060/AAAA.java b110060.AAAA() [AAAA] 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/AxAyAz.java b110060.AxAyAz() [AxAyAz] EXACT_MATCH\n" + > "src/b110060/AxxAyy.java b110060.AxxAyy() [AxxAyy] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.aa [new AA()] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.aaaa [new AAAA()] EXACT_MATCH\n" + > "src/b110060/Test.java b110060.Test.aaxx [new AAxx()] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axa [new AxA()] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.axayaz [new AxAyAz()] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.axxayy [new AxxAyy()] EXACT_MATCH" >+ ); >+} >+public void testBug110060_ConstructorPattern02_SamePartCount() throws CoreException { >+ setUpBug110060_ConstructorPattern(); >+ search("AA", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults( >+ "src/b110060/AAxx.java b110060.AAxx() [AAxx] EXACT_MATCH\n" + >+ "src/b110060/AxxAyy.java b110060.AxxAyy() [AxxAyy] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.aaxx [new AAxx()] EXACT_MATCH\n" + > "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_CAMEL_CASE_MATCH); >+ search("AAx", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( >- "" // no match as prefix is not set >+ "src/b110060/AAxx.java b110060.AAxx() [AAxx] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.aaxx [new AAxx()] EXACT_MATCH" >+ ); >+} >+public void testBug110060_ConstructorPattern03_SamePartCount() throws CoreException { >+ setUpBug110060_ConstructorPattern(); >+ search("AAx", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults( >+ "src/b110060/AAxx.java b110060.AAxx() [AAxx] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.aaxx [new AAxx()] EXACT_MATCH" > ); > } > public void testBug110060_ConstructorPattern04() throws CoreException { > setUpBug110060_ConstructorPattern(); >- search("Axx", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("AxA", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >+ assertSearchResults( >+ "src/b110060/AxAyAz.java b110060.AxAyAz() [AxAyAz] EXACT_MATCH\n" + >+ "src/b110060/AxxAyy.java b110060.AxxAyy() [AxxAyy] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.axayaz [new AxAyAz()] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.axxayy [new AxxAyy()] EXACT_MATCH" >+ ); >+} >+public void testBug110060_ConstructorPattern04_SamePartCount() throws CoreException { >+ setUpBug110060_ConstructorPattern(); >+ search("AxA", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > assertSearchResults( >- "" // no match as prefix is not set >+ "src/b110060/AxxAyy.java b110060.AxxAyy() [AxxAyy] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.axxayy [new AxxAyy()] EXACT_MATCH" > ); > } > public void testBug110060_ConstructorPattern05() throws CoreException { > setUpBug110060_ConstructorPattern(); >- search("Ax", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("A*A*", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >+ // Invalid camel case pattern => replace the camel case flag with pattern match one (case insensitive) > assertSearchResults( >- "" // no match as prefix is not set >+ "src/b110060/AAAA.java b110060.AAAA() [AAAA] EXACT_MATCH\n" + >+ "src/b110060/AAxx.java b110060.AAxx() [AAxx] EXACT_MATCH\n" + >+ "src/b110060/AxAyAz.java b110060.AxAyAz() [AxAyAz] EXACT_MATCH\n" + >+ "src/b110060/AxxAyy.java b110060.AxxAyy() [AxxAyy] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.aaaa [new AAAA()] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.aaxx [new AAxx()] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.axayaz [new AxAyAz()] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.axxayy [new AxxAyy()] EXACT_MATCH" > ); > } >-public void testBug110060_ConstructorPattern06() throws CoreException { >+public void testBug110060_ConstructorPattern05_SamePartCount() throws CoreException { > setUpBug110060_ConstructorPattern(); >- search("A*A*", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("A*A*", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ // Invalid camel case pattern => replace the camel case flag with pattern match one (case insensitive) > assertSearchResults( >- "src/b110060/AA.java b110060.AA() [AA] EXACT_MATCH\n" + >+ "src/b110060/AAAA.java b110060.AAAA() [AAAA] 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/AxAyAz.java b110060.AxAyAz() [AxAyAz] EXACT_MATCH\n" + > "src/b110060/AxxAyy.java b110060.AxxAyy() [AxxAyy] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.aa [new AA()] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.aaaa [new AAAA()] EXACT_MATCH\n" + > "src/b110060/Test.java b110060.Test.aaxx [new AAxx()] EXACT_MATCH\n" + >- "src/b110060/Test.java b110060.Test.axa [new AxA()] EXACT_MATCH\n" + >+ "src/b110060/Test.java b110060.Test.axayaz [new AxAyAz()] EXACT_MATCH\n" + > "src/b110060/Test.java b110060.Test.axxayy [new AxxAyy()] EXACT_MATCH" > ); > } >@@ -5396,29 +5454,26 @@ > "}\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_MethodPattern01new() throws CoreException { >+public void testBug110060_MethodPattern01_SamePartCount() throws CoreException { > setUpBug110060_MethodPattern(); >- search("MWD", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("MWD", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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 { >+public void testBug110060_MethodPattern02_SamePartCount() throws CoreException { > setUpBug110060_MethodPattern(); >- search("AMWD", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("AMWD", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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); >@@ -5429,15 +5484,14 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1DigitAnd_AnUnderscore()] EXACT_MATCH" > ); > } >-public void testBug110060_MethodPattern03new() throws CoreException { >+public void testBug110060_MethodPattern03_SamePartCount() throws CoreException { > setUpBug110060_MethodPattern(); >- search("aMWD", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("aMWD", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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); >@@ -5452,14 +5506,13 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWithNothingSpecial()] EXACT_MATCH" > ); > } >-public void testBug110060_MethodPattern04new() throws CoreException { >+public void testBug110060_MethodPattern04_SamePartCount() throws CoreException { > setUpBug110060_MethodPattern(); >- search("aMW", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("aMW", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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); >@@ -5474,14 +5527,11 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWithNothingSpecial()] EXACT_MATCH" > ); > } >-public void testBug110060_MethodPattern05new() throws CoreException { >+public void testBug110060_MethodPattern05_SamePartCount() throws CoreException { > setUpBug110060_MethodPattern(); >- search("aMethod", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >- assertSearchResults( >- "" // no result as prefix match is not set >- ); >+ search("aMethod", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults(""); > } >-/** @deprecated As using a depreciated constant */ > public void testBug110060_MethodPattern06() throws CoreException { > setUpBug110060_MethodPattern(); > search("aMethodWith1", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -5494,17 +5544,15 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores()] EXACT_MATCH" > ); > } >-public void testBug110060_MethodPattern06new() throws CoreException { >+public void testBug110060_MethodPattern06_SamePartCount() throws CoreException { > setUpBug110060_MethodPattern(); >- search("aMethodWith1", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >- assertSearchResults( >- "" // no result as prefix match is not set >- ); >+ search("aMethodWith1", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults(""); > } >-/** @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); >+ // Invalid camel case pattern => replace the camel case flag with pattern match one (case insensitive) > 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" + >@@ -5516,9 +5564,10 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [otherMethodWhichStartsWithAnotherLetter()] EXACT_MATCH" > ); > } >-public void testBug110060_MethodPattern07new() throws CoreException { >+public void testBug110060_MethodPattern07_SamePartCount() throws CoreException { > setUpBug110060_MethodPattern(); >- search("*Method*With*A*", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("*Method*With*A*", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ // Invalid camel case pattern => replace the camel case flag with pattern match one (case insensitive) > 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" + >@@ -5530,7 +5579,6 @@ > "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); >@@ -5541,15 +5589,14 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1DigitAnd_AnUnderscore()] EXACT_MATCH" > ); > } >-public void testBug110060_MethodPattern08new() throws CoreException { >+public void testBug110060_MethodPattern08_SamePartCount() throws CoreException { > setUpBug110060_MethodPattern(); >- search("aMW1D", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("aMW1D", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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); >@@ -5558,9 +5605,9 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores()] EXACT_MATCH" > ); > } >-public void testBug110060_MethodPattern09new() throws CoreException { >+public void testBug110060_MethodPattern09_SamePartCount() throws CoreException { > setUpBug110060_MethodPattern(); >- search("aMWOOODASU", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("aMWOOODASU", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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" >@@ -5588,7 +5635,6 @@ > "}\n" > ); > } >-/** @deprecated As using a depreciated constant */ > public void testBug110060_FieldPattern01() throws CoreException { > setUpBug110060_FieldPattern(); > search("aFWSD", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -5599,26 +5645,24 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aFieldWith$Several$DollarslAnd1DigitAnd_1Underscore] EXACT_MATCH" > ); > } >-public void testBug110060_FieldPattern01new() throws CoreException { >+public void testBug110060_FieldPattern01_SamePartCount() throws CoreException { > setUpBug110060_FieldPattern(); >- search("aFWSD", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("aFWSD", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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 { >+public void testBug110060_FieldPattern02_SamePartCount() throws CoreException { > setUpBug110060_FieldPattern(); >- search("afwsd", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("afwsd", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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); >@@ -5627,14 +5671,11 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aFieldWithS$Dollar] EXACT_MATCH" > ); > } >-public void testBug110060_FieldPattern03new() throws CoreException { >+public void testBug110060_FieldPattern03_SamePartCount() throws CoreException { > setUpBug110060_FieldPattern(); >- search("aFWS$", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >- assertSearchResults( >- "" // no result as prefix match is not set >- ); >+ search("aFWS$", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults(""); > } >-/** @deprecated As using a depreciated constant */ > public void testBug110060_FieldPattern04() throws CoreException { > setUpBug110060_FieldPattern(); > search("aSFWSCD", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); >@@ -5643,15 +5684,14 @@ > "src/b110060/Test.java void b110060.Test.testReferences() [aStrangeFieldWith$$$$$$$$$$$$$$$SeveraContiguousDollars] EXACT_MATCH" > ); > } >-public void testBug110060_FieldPattern04new() throws CoreException { >+public void testBug110060_FieldPattern04_SamePartCount() throws CoreException { > setUpBug110060_FieldPattern(); >- search("aSFWSCD", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("aSFWSCD", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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); >@@ -5663,7 +5703,7 @@ > } > public void testBug110060_FieldPattern05new() throws CoreException { > setUpBug110060_FieldPattern(); >- search("oF", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("oF", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > assertSearchResults( > "src/b110060/Test.java b110060.Test.oF [oF] EXACT_MATCH" > ); >@@ -5688,7 +5728,7 @@ > } > > /** >- * @test Bug 110336: [plan][search] Should optionaly return the local variable for type reference >+ * @test Bug 110336: [plan][search] Should optionally return the local variable for type reference > * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=110336" > */ > public void testBug110336a() throws CoreException { >@@ -6455,263 +6495,168 @@ > * @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 { >+private void setupBug124624() throws JavaModelException { > 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" >+ "class HaxMapxxxx {}\n" > ); > } >-/** @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" >- ); >+public void testBug124624_HM_CamelCase() throws CoreException { >+ setupBug124624(); > 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" >+ "src/Test.java HaxMapxxxx [HaxMapxxxx] 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); >+public void testBug124624_HM_CamelCaseSamePartCount() throws CoreException { >+ setupBug124624(); >+ search("HM", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > assertSearchResults( > "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >- "src/Test.java HatMappage [HatMappage] EXACT_MATCH" >+ "src/Test.java HtmlMapper [HtmlMapper] EXACT_MATCH\n" + >+ "src/Test.java HaxMapxxxx [HaxMapxxxx] 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" >- ); >+public void testBug124624_HaM_CamelCase() throws CoreException { >+ setupBug124624(); > 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" >+ "src/Test.java HaxMapxxxx [HaxMapxxxx] 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); >+public void testBug124624_HaM_CamelCaseSamePartCount() throws CoreException { >+ setupBug124624(); >+ search("HaM", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > assertSearchResults( >- "src/Test.java HashMap [HashMap] EXACT_MATCH" >+ "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >+ "src/Test.java HaxMapxxxx [HaxMapxxxx] 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" >- ); >+public void testBug124624_HashM_CamelCase() throws CoreException { >+ setupBug124624(); > 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" >+public void testBug124624_HashM_CamelCaseSamePartCount() throws CoreException { >+ setupBug124624(); >+ search("HashM", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH" > ); >- 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" >- ); >+public void testBug124624_HMa_CamelCase() throws CoreException { >+ setupBug124624(); > 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" >+ "src/Test.java HaxMapxxxx [HaxMapxxxx] 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" >+public void testBug124624_HMa_CamelCaseSamePartCount() throws CoreException { >+ setupBug124624(); >+ search("HMa", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >+ "src/Test.java HtmlMapper [HtmlMapper] EXACT_MATCH\n" + >+ "src/Test.java HaxMapxxxx [HaxMapxxxx] EXACT_MATCH" > ); >- 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); >+public void testBug124624_HaMa_CamelCase() throws CoreException { >+ setupBug124624(); >+ search("HaMa", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( > "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >- "src/Test.java HashMapEntry [HashMapEntry] EXACT_MATCH" >+ "src/Test.java HashMapEntry [HashMapEntry] EXACT_MATCH\n" + >+ "src/Test.java HaxMapxxxx [HaxMapxxxx] 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" >+public void testBug124624_HaMa_CamelCaseSamePartCount() throws CoreException { >+ setupBug124624(); >+ search("HaMa", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >+ "src/Test.java HaxMapxxxx [HaxMapxxxx] EXACT_MATCH" > ); >- 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); >+public void testBug124624_HashMa_CamelCase() throws CoreException { >+ setupBug124624(); >+ 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_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); >+public void testBug124624_HashMa_CamelCaseSamePartCount() throws CoreException { >+ setupBug124624(); >+ search("HashMa", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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" >- ); >+public void testBug124624_HMap_CamelCase() throws CoreException { >+ setupBug124624(); > 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" >+ "src/Test.java HaxMapxxxx [HaxMapxxxx] 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); >+public void testBug124624_HMap_CamelCaseSamePartCount() throws CoreException { >+ setupBug124624(); >+ search("HMap", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > assertSearchResults( >- "src/Test.java HashMap [HashMap] EXACT_MATCH" >+ "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >+ "src/Test.java HtmlMapper [HtmlMapper] EXACT_MATCH\n" + >+ "src/Test.java HaxMapxxxx [HaxMapxxxx] 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" >- ); >+public void testBug124624_HaMap_CamelCase() throws CoreException { >+ setupBug124624(); > 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" >+ "src/Test.java HaxMapxxxx [HaxMapxxxx] 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); >+public void testBug124624_HaMap_CamelCaseSamePartCount() throws CoreException { >+ setupBug124624(); >+ search("HaMap", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > assertSearchResults( >- "src/Test.java HashMap [HashMap] EXACT_MATCH" >+ "src/Test.java HashMap [HashMap] EXACT_MATCH\n" + >+ "src/Test.java HaxMapxxxx [HaxMapxxxx] 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" >- ); >+public void testBug124624_HashMap_CamelCase() throws CoreException { >+ setupBug124624(); > 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" > ); > } >+public void testBug124624_HashMap_CamelCaseSamePartCount() throws CoreException { >+ setupBug124624(); >+ search("HashMap", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); >+ assertSearchResults( >+ "src/Test.java HashMap [HashMap] EXACT_MATCH" >+ ); >+} > > /** > * @test Bug 124645: [search] for implementors does not find subclasses of binary classes >@@ -6906,23 +6851,21 @@ > "}\n" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testBug130390() throws CoreException { >+public void testBug130390_CamelCase() throws CoreException { > setUpBug130390(); > search("NuPoEx", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( > "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH" > ); > } >-public void testBug130390_new() throws CoreException { >+public void testBug130390_CamelCaseSamePartCount() throws CoreException { > setUpBug130390(); >- search("NuPoEx", TYPE, DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("NuPoEx", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > assertSearchResults( >- "" // no result as prefix match is not set >+ "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testBug130390b() throws CoreException { >+public void testBug130390b_CamelCase() throws CoreException { > setUpBug130390(); > search("NPE", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( >@@ -6930,76 +6873,70 @@ > "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH" > ); > } >-public void testBug130390b_new() throws CoreException { >+public void testBug130390b_CamelCaseSamePartCount() throws CoreException { > setUpBug130390(); >- search("NPE", TYPE, DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("NPE", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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 { >+public void testBug130390c_CamelCase() throws CoreException { > setUpBug130390(); > search("NPE", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE); > assertSearchResults( > "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH" > ); > } >-public void testBug130390c_new() throws CoreException { >+public void testBug130390c_CamelCaseSamePartCount() throws CoreException { > setUpBug130390(); >- search("NPE", TYPE, DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ search("NPE", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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 { >+public void testBug130390d_CamelCase() throws CoreException { > setUpBug130390(); > search("Npe", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( > "src/b130390/Npe.java b130390.Npe [Npe] EXACT_MATCH" > ); > } >-public void testBug130390d_new() throws CoreException { >+public void testBug130390d_CamelCaseSamePartCount() throws CoreException { > setUpBug130390(); >- search("Npe", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("Npe", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > assertSearchResults( > "src/b130390/Npe.java b130390.Npe [Npe] EXACT_MATCH" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testBug130390e() throws CoreException { >+public void testBug130390e_CamelCase() throws CoreException { > setUpBug130390(); > search("Npe", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE); > assertSearchResults( > "src/b130390/Npe.java b130390.Npe [Npe] EXACT_MATCH" > ); > } >-public void testBug130390e_new() throws CoreException { >+public void testBug130390e_CamelCaseSamePartCount() throws CoreException { > setUpBug130390(); >- search("Npe", TYPE, DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ search("Npe", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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 { >+public void testBug130390f_CamelCase() throws CoreException { > setUpBug130390(); > search("NullPE", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); > assertSearchResults( > "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH" > ); > } >-public void testBug130390f_new() throws CoreException { >+public void testBug130390f_CamelCaseSamePartCount() throws CoreException { > setUpBug130390(); >- search("NullPE", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMEL_CASE_MATCH); >+ search("NullPE", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > assertSearchResults( > "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testBug130390g() throws CoreException { >+public void testBug130390g_CamelCase() throws CoreException { > setUpBug130390(); > search("TZ", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE); > assertSearchResults( >@@ -7007,19 +6944,26 @@ > "src/b130390/TimeZone.java b130390.TimeZone [TimeZone] EXACT_MATCH" > ); > } >-public void testBug130390g_new() throws CoreException { >+public void testBug130390g_CamelCaseSamePartCount() throws CoreException { > setUpBug130390(); >- search("TZ", TYPE, DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ search("TZ", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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 { >+public void testBug130390h_CamelCase() throws CoreException { > setUpBug130390(); >- search("TiZo", TYPE, DECLARATIONS, SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ search("TiZo", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE); > assertSearchResults( >- "" // no result as prefix match is not set >+ "src/b130390/TimeZone.java b130390.TimeZone [TimeZone] EXACT_MATCH" >+ ); >+} >+public void testBug130390h_CamelCaseSamePartCount() throws CoreException { >+ setUpBug130390(); >+ search("TiZo", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ assertSearchResults( >+ "src/b130390/TimeZone.java b130390.TimeZone [TimeZone] EXACT_MATCH" > ); > } > >@@ -7029,9 +6973,8 @@ > * > * @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 { >+public void testBug137087_CamelCase() throws CoreException { > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "runtimeEx"; > search(pattern, TYPE, DECLARATIONS, matchRule); >@@ -7039,8 +6982,7 @@ > ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testBug137087b() throws CoreException { >+public void testBug137087b_CamelCase() throws CoreException { > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "Runtimeex"; > search(pattern, TYPE, DECLARATIONS, matchRule); >@@ -7048,18 +6990,15 @@ > ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testBug137087c() throws CoreException { >+public void testBug137087c_CamelCase() throws CoreException { > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "runtimeexception"; > search(pattern, TYPE, DECLARATIONS, matchRule); > assertSearchResults( >- "" // no result because it's an invalid camel case pattern which is replaced with >- // prefix case sensitive match bu SearchPatter.validateMatchRule(...) (old behavior) >+ ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testBug137087d() throws CoreException { >+public void testBug137087d_CamelCase() throws CoreException { > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "Runtimexception"; > search(pattern, TYPE, DECLARATIONS, matchRule); >@@ -7067,8 +7006,7 @@ > "" // no match expected as pattern is missing a 'e' > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testBug137087e() throws CoreException { >+public void testBug137087e_CamelCase() throws CoreException { > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "IllegalMSException"; > search(pattern, TYPE, DECLARATIONS, matchRule); >@@ -7076,8 +7014,7 @@ > ""+ getExternalJCLPathString("1.5") + " java.lang.IllegalMonitorStateException EXACT_MATCH" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testBug137087f() throws CoreException { >+public void testBug137087f_CamelCase() throws CoreException { > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "illegalMsExceptionSException"; > search(pattern, TYPE, DECLARATIONS, matchRule); >@@ -7085,18 +7022,15 @@ > "" // 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 { >+public void testBug137087g_CamelCase() throws CoreException { > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "clonenotsupportedex"; > search(pattern, TYPE, DECLARATIONS, matchRule); > assertSearchResults( >- "" // no result because it's an invalid camel case pattern which is replaced with >- // prefix case sensitive match bu SearchPatter.validateMatchRule(...) (old behavior) >+ ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testBug137087h() throws CoreException { >+public void testBug137087h_CamelCase() throws CoreException { > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "CloneNotSupportedEx"; > search(pattern, TYPE, DECLARATIONS, matchRule); >@@ -7104,8 +7038,7 @@ > ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testBug137087i() throws CoreException { >+public void testBug137087i_CamelCase() throws CoreException { > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "cloneNotsupportedEx"; > search(pattern, TYPE, DECLARATIONS, matchRule); >@@ -7113,8 +7046,7 @@ > ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testBug137087j() throws CoreException { >+public void testBug137087j_CamelCase() throws CoreException { > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "ClonenotSupportedexc"; > search(pattern, TYPE, DECLARATIONS, matchRule); >@@ -7122,8 +7054,7 @@ > ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testBug137087k() throws CoreException { >+public void testBug137087k_CamelCase() throws CoreException { > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "cloneNotSupportedExcep"; > search(pattern, TYPE, DECLARATIONS, matchRule); >@@ -7131,8 +7062,7 @@ > ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testBug137087l() throws CoreException { >+public void testBug137087l_CamelCase() throws CoreException { > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "Clonenotsupportedexception"; > search(pattern, TYPE, DECLARATIONS, matchRule); >@@ -7140,8 +7070,7 @@ > ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" > ); > } >-/** @deprecated As using a depreciated constant */ >-public void testBug137087m() throws CoreException { >+public void testBug137087m_CamelCase() throws CoreException { > int matchRule = SearchPattern.R_CAMELCASE_MATCH; > String pattern = "CloneNotSupportedException"; > search(pattern, TYPE, DECLARATIONS, matchRule); >@@ -7149,6 +7078,99 @@ > ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" > ); > } >+// Same tests using SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH >+public void testBug137087_CamelCaseSamePartCount() throws CoreException { >+ int matchRule = SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH; >+ String pattern = "runtimeEx"; >+ search(pattern, TYPE, DECLARATIONS, matchRule); >+ assertSearchResults(""); >+} >+public void testBug137087b_CamelCaseSamePartCount() throws CoreException { >+ int matchRule = SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH; >+ String pattern = "Runtimeex"; >+ search(pattern, TYPE, DECLARATIONS, matchRule); >+ assertSearchResults(""); >+} >+public void testBug137087c_CamelCaseSamePartCount() throws CoreException { >+ int matchRule = SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH; >+ String pattern = "runtimeexception"; >+ search(pattern, TYPE, DECLARATIONS, matchRule); >+ assertSearchResults( >+ ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH" >+ ); >+} >+public void testBug137087d_CamelCaseSamePartCount() throws CoreException { >+ int matchRule = SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH; >+ String pattern = "Runtimexception"; >+ search(pattern, TYPE, DECLARATIONS, matchRule); >+ assertSearchResults( >+ "" // no match expected as pattern is missing a 'e' >+ ); >+} >+public void testBug137087e_CamelCaseSamePartCount() throws CoreException { >+ int matchRule = SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH; >+ String pattern = "IllegalMSException"; >+ search(pattern, TYPE, DECLARATIONS, matchRule); >+ assertSearchResults( >+ ""+ getExternalJCLPathString("1.5") + " java.lang.IllegalMonitorStateException EXACT_MATCH" >+ ); >+} >+public void testBug137087f_CamelCaseSamePartCount() throws CoreException { >+ int matchRule = SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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 >+ ); >+} >+public void testBug137087g_CamelCaseSamePartCount() throws CoreException { >+ int matchRule = SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH; >+ String pattern = "clonenotsupportedex"; >+ search(pattern, TYPE, DECLARATIONS, matchRule); >+ assertSearchResults( >+ ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" >+ ); >+} >+public void testBug137087h_CamelCaseSamePartCount() throws CoreException { >+ int matchRule = SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH; >+ String pattern = "CloneNotSupportedEx"; >+ search(pattern, TYPE, DECLARATIONS, matchRule); >+ assertSearchResults( >+ ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" >+ ); >+} >+public void testBug137087i_CamelCaseSamePartCount() throws CoreException { >+ int matchRule = SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH; >+ String pattern = "cloneNotsupportedEx"; >+ search(pattern, TYPE, DECLARATIONS, matchRule); >+ assertSearchResults(""); >+} >+public void testBug137087j_CamelCaseSamePartCount() throws CoreException { >+ int matchRule = SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH; >+ String pattern = "ClonenotSupportedexc"; >+ search(pattern, TYPE, DECLARATIONS, matchRule); >+ assertSearchResults(""); >+} >+public void testBug137087k_CamelCaseSamePartCount() throws CoreException { >+ int matchRule = SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH; >+ String pattern = "cloneNotSupportedExcep"; >+ search(pattern, TYPE, DECLARATIONS, matchRule); >+ assertSearchResults(""); >+} >+public void testBug137087l_CamelCaseSamePartCount() throws CoreException { >+ int matchRule = SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH; >+ String pattern = "Clonenotsupportedexception"; >+ search(pattern, TYPE, DECLARATIONS, matchRule); >+ assertSearchResults(""); >+} >+public void testBug137087m_CamelCaseSamePartCount() throws CoreException { >+ int matchRule = SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH; >+ String pattern = "CloneNotSupportedException"; >+ search(pattern, TYPE, DECLARATIONS, matchRule); >+ assertSearchResults( >+ ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" >+ ); >+} > > /** > * Bug 137984: [search] Field references not found when type is a qualified member type [regression] >@@ -8844,48 +8866,160 @@ > * @test Ensure that indexing still works properly after close/restart > * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=201064" > */ >-public void testBug201064() throws CoreException { >+public void testBug201064a_CamelCase() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CCase", SearchPattern.R_CAMELCASE_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCaseEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCasexxEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CxxCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CxxxxCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); >+} >+public void testBug201064b_CamelCase() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CaCase", SearchPattern.R_CAMELCASE_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCaseEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCasexxEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); >+} >+public void testBug201064c_CamelCase() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CamelCase", SearchPattern.R_CAMELCASE_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCaseEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCasexxEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); >+} >+public void testBug201064d_CamelCase() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CC", SearchPattern.R_CAMELCASE_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCaseEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCasexxEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CxxCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CxxxxCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); >+} >+public void testBug201064e_CamelCase() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CaC", SearchPattern.R_CAMELCASE_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCaseEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCasexxEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); >+} >+public void testBug201064f_CamelCase() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CamelC", SearchPattern.R_CAMELCASE_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCaseEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCasexxEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); >+} >+public void testBug201064g_CamelCase() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CCa", SearchPattern.R_CAMELCASE_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCaseEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCasexxEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CxxCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CxxxxCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); >+} >+public void testBug201064h_CamelCase() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CaCa", SearchPattern.R_CAMELCASE_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCaseEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCasexxEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); >+} >+public void testBug201064i_CamelCase() throws CoreException { >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ searchAllTypeNames("CamelCa", SearchPattern.R_CAMELCASE_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCaseEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CamelCasexxEntry (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); >+} >+// Same tests using SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH >+public void testBug201064a_CamelCaseSamePartCount() throws CoreException { > TypeNameMatchCollector collector = new TypeNameMatchCollector(); >- searchAllTypeNames("CCase", SearchPattern.R_CAMEL_CASE_MATCH, collector); >+ searchAllTypeNames("CCase", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, collector); > assertSearchResults( > "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + > "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >- "CxxCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ "CatCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CxxCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CxxxxCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", > collector > ); > } >-public void testBug201064b() throws CoreException { >+public void testBug201064b_CamelCaseSamePartCount() throws CoreException { > TypeNameMatchCollector collector = new TypeNameMatchCollector(); >- searchAllTypeNames("CaCase", SearchPattern.R_CAMEL_CASE_MATCH, collector); >+ searchAllTypeNames("CaCase", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, collector); > assertSearchResults( > "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >- "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", > collector > ); > } >-public void testBug201064c() throws CoreException { >+public void testBug201064c_CamelCaseSamePartCount() throws CoreException { > TypeNameMatchCollector collector = new TypeNameMatchCollector(); >- searchAllTypeNames("CamelCase", SearchPattern.R_CAMEL_CASE_MATCH, collector); >+ searchAllTypeNames("CamelCase", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, collector); > assertSearchResults( > "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", > collector > ); > } >-public void testBug201064d() throws CoreException { >+public void testBug201064d_CamelCaseSamePartCount() throws CoreException { > TypeNameMatchCollector collector = new TypeNameMatchCollector(); >- searchAllTypeNames("CC", SearchPattern.R_CAMEL_CASE_MATCH, collector); >+ searchAllTypeNames("CC", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, collector); > assertSearchResults( > "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + > "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + > "CatCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >- "CxxCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CxxCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + > "CxxxxCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", > collector > ); > } >-public void testBug201064e() throws CoreException { >+public void testBug201064e_CamelCaseSamePartCount() throws CoreException { > TypeNameMatchCollector collector = new TypeNameMatchCollector(); >- searchAllTypeNames("CaC", SearchPattern.R_CAMEL_CASE_MATCH, collector); >+ searchAllTypeNames("CaC", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, collector); > assertSearchResults( > "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + > "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >@@ -8893,28 +9027,43 @@ > collector > ); > } >-public void testBug201064f() throws CoreException { >+public void testBug201064f_CamelCaseSamePartCount() throws CoreException { > TypeNameMatchCollector collector = new TypeNameMatchCollector(); >- searchAllTypeNames("CamelC", SearchPattern.R_CAMEL_CASE_MATCH, collector); >+ searchAllTypeNames("CamelC", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, collector); > assertSearchResults( > "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", > collector > ); > } >-public void testBug201064g() throws CoreException { >+public void testBug201064g_CamelCaseSamePartCount() throws CoreException { > TypeNameMatchCollector collector = new TypeNameMatchCollector(); >- searchAllTypeNames("CCa", SearchPattern.R_CAMEL_CASE_MATCH, collector); >- assertSearchResults("", collector); >+ searchAllTypeNames("CCa", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CxxCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CxxxxCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); > } >-public void testBug201064h() throws CoreException { >+public void testBug201064h_CamelCaseSamePartCount() throws CoreException { > TypeNameMatchCollector collector = new TypeNameMatchCollector(); >- searchAllTypeNames("CaCa", SearchPattern.R_CAMEL_CASE_MATCH, collector); >- assertSearchResults("", collector); >+ searchAllTypeNames("CaCa", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]\n" + >+ "CatCasexx (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); > } >-public void testBug201064i() throws CoreException { >+public void testBug201064i_CamelCaseSamePartCount() throws CoreException { > TypeNameMatchCollector collector = new TypeNameMatchCollector(); >- searchAllTypeNames("CamelCa", SearchPattern.R_CAMEL_CASE_MATCH, collector); >- assertSearchResults("", collector); >+ searchAllTypeNames("CamelCa", SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, collector); >+ assertSearchResults( >+ "CamelCase (not open) [in CamelCase.java [in b201064 [in src [in JavaSearchBugs]]]]", >+ collector >+ ); > } > > /** >@@ -8928,16 +9077,7 @@ > try { > addLibraryEntry(javaProject, new Path("/JavaSearchBugs/b204652.jar"), false/*not exported*/); > TypeNameMatchCollector collector = new TypeNameMatchCollector(); >- new SearchEngine().searchAllTypeNames( >- "b204652".toCharArray(), >- SearchPattern.R_EXACT_MATCH, >- null, >- SearchPattern.R_PREFIX_MATCH, >- IJavaSearchConstants.TYPE, >- getJavaSearchScope(), >- collector, >- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >- null); >+ searchAllTypeNames("b204652", null, SearchPattern.R_PREFIX_MATCH, collector); > IPackageFragment pkg = getPackage("/JavaSearchBugs/b204652.jar/b204652"); > pkg.open(null); > IType result = (IType) collector.matches.get(0); >@@ -8946,5 +9086,4 @@ > javaProject.setRawClasspath(originalRawClasspath, null); > } > } >- > } >\ No newline at end of file >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.43 >diff -u -r1.43 SearchTests.java >--- src/org/eclipse/jdt/core/tests/model/SearchTests.java 28 Aug 2007 10:03:35 -0000 1.43 >+++ src/org/eclipse/jdt/core/tests/model/SearchTests.java 1 Oct 2007 11:59:45 -0000 >@@ -1022,15 +1022,14 @@ > 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); >+ SearchPattern.R_PREFIX_MATCH); > } > public void testSearchPatternValidMatchRule06() { > assertValidMatchRule("foo", >- SearchPattern.R_CAMEL_CASE_MATCH, >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, > SearchPattern.R_PREFIX_MATCH); > } > public void testSearchPatternValidMatchRule10() { >@@ -1053,7 +1052,6 @@ > 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, >@@ -1061,102 +1059,97 @@ > } > public void testSearchPatternValidMatchRule15() { > assertValidMatchRule("CP*P", >- SearchPattern.R_CAMEL_CASE_MATCH, >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE); > } >-/** @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); >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > } > public void testSearchPatternValidMatchRule31() { > assertValidMatchRule("NPE", >- SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH); >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH | SearchPattern.R_PREFIX_MATCH, >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > } > public void testSearchPatternValidMatchRule32() { > assertValidMatchRule("NPE", >- SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH | SearchPattern.R_CASE_SENSITIVE); > } > public void testSearchPatternValidMatchRule33() { > assertValidMatchRule("NPE", >- SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE); >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH | SearchPattern.R_CASE_SENSITIVE); > } > public void testSearchPatternValidMatchRule34() { > assertValidMatchRule("nPE", >- SearchPattern.R_CAMEL_CASE_MATCH); >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > } > public void testSearchPatternValidMatchRule35() { > assertValidMatchRule("NuPoEx", >- SearchPattern.R_CAMEL_CASE_MATCH); >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > } > public void testSearchPatternValidMatchRule36() { > assertValidMatchRule("oF", >- SearchPattern.R_CAMEL_CASE_MATCH); >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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); > } >-/** @deprecated As using a depreciated constant */ > public void testSearchPatternValidMatchRule41() { > assertValidMatchRule("Nu.Po.Ex", > SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH, > SearchPattern.R_PREFIX_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, > SearchPattern.R_CAMELCASE_MATCH); > } > public void testSearchPatternValidMatchRule44() { > assertValidMatchRule("Nu/Po/Ex", >- SearchPattern.R_CAMEL_CASE_MATCH, >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, > SearchPattern.R_PREFIX_MATCH); > } > public void testSearchPatternValidMatchRule45() { > assertValidMatchRule("Nu.Po.Ex", >- SearchPattern.R_CAMEL_CASE_MATCH | SearchPattern.R_PREFIX_MATCH, >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH | SearchPattern.R_PREFIX_MATCH, > SearchPattern.R_PREFIX_MATCH); > } > public void testSearchPatternValidMatchRule46() { > assertValidMatchRule("hashMap", >- SearchPattern.R_CAMEL_CASE_MATCH); >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > } > public void testSearchPatternValidMatchRule47() { > assertValidMatchRule("Hashmap", >- SearchPattern.R_CAMEL_CASE_MATCH); >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH, >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH); > } > > /** >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.28 >diff -u -r1.28 AbstractJavaSearchTests.java >--- src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java 24 Aug 2007 13:52:11 -0000 1.28 >+++ src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java 1 Oct 2007 11:59:43 -0000 >@@ -659,10 +659,13 @@ > ); > } > protected void searchAllTypeNames(String pattern, int matchRule, TypeNameMatchCollector collector) throws JavaModelException { >+ searchAllTypeNames(null, pattern, matchRule, collector); >+ } >+ protected void searchAllTypeNames(String packagePattern, String typePattern, int matchRule, TypeNameMatchCollector collector) throws JavaModelException { > new SearchEngine(this.workingCopies).searchAllTypeNames( >- null, >+ packagePattern==null ? null : packagePattern.toCharArray(), > SearchPattern.R_EXACT_MATCH, >- pattern.toCharArray(), >+ typePattern==null ? null : typePattern.toCharArray(), > matchRule, > TYPE, > getJavaSearchScope(), >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.44 >diff -u -r1.44 JavaSearchMultipleProjectsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchMultipleProjectsTests.java 24 Aug 2007 05:58:27 -0000 1.44 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchMultipleProjectsTests.java 1 Oct 2007 11:59:44 -0000 >@@ -923,7 +923,6 @@ > * @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 { >@@ -961,7 +960,7 @@ > deleteProject("Test.jar"); > } > } >-public void testBug199392_Jar_new() throws CoreException { >+public void testBug199392_Jar_SamePartCount() throws CoreException { > try { > IJavaProject project = createJavaProject("Test.jar"); > createFolder("/Test.jar/test"); >@@ -983,21 +982,20 @@ > null, > SearchPattern.R_EXACT_MATCH, > new char[] { 'M', 'y' }, >- SearchPattern.R_CAMEL_CASE_MATCH, >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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"); >@@ -1034,7 +1032,7 @@ > deleteProject("Test.zip"); > } > } >-public void testBug199392_Zip_new() throws CoreException { >+public void testBug199392_Zip_SamePartCount() throws CoreException { > try { > IJavaProject project = createJavaProject("Test.zip"); > createFolder("/Test.zip/test"); >@@ -1056,14 +1054,14 @@ > null, > SearchPattern.R_EXACT_MATCH, > new char[] { 'M', 'y' }, >- SearchPattern.R_CAMEL_CASE_MATCH, >+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_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 { >#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.34 >diff -u -r1.34 UtilTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java 24 Aug 2007 05:58:32 -0000 1.34 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java 1 Oct 2007 11:59:47 -0000 >@@ -37,7 +37,7 @@ > * If result is invalid then store warning in buffer and display it. > */ > void assertCamelCase(String pattern, String name, boolean match) { >- assertCamelCase(pattern, name, true /*prefix match*/, match); >+ assertCamelCase(pattern, name, false /* name may have more parts*/, match); > } > /** > * Assert that a pattern and a name matches or not. >@@ -619,55 +619,55 @@ > > // 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 */); >+ assertCamelCase("IDE3", "IDocumentExtension", true /*same part count*/, false /* should not match */); >+ assertCamelCase("IDE3", "IDocumentExtension2", true /*same part count*/, false /* should not match */); >+ assertCamelCase("IDE3", "IDocumentExtension3", true /*same part count*/, true /* should match */); >+ assertCamelCase("IDE3", "IDocumentExtension135", true /*same part count*/, true /* should match */); >+ assertCamelCase("IDE3", "IDocumentExtension315", true /*same part count*/, true /* should match */); >+ assertCamelCase("IDPE3", "IDocumentProviderExtension", true /*same part count*/, false /* should not match */); >+ assertCamelCase("IDPE3", "IDocumentProviderExtension2", true /*same part count*/, false /* should not match */); >+ assertCamelCase("IDPE3", "IDocumentProviderExtension4", true /*same part count*/, false /* should not match */); >+ assertCamelCase("IDPE3", "IDocumentProviderExtension3", true /*same part count*/, true /* should match */); >+ assertCamelCase("IDPE3", "IDocumentProviderExtension5", true /*same part count*/, false /* should not match */); >+ assertCamelCase("IDPE3", "IDocumentProviderExtension54321", true /*same part count*/, true /* should match */); >+ assertCamelCase("IDPE3", "IDocumentProviderExtension12345", true /*same part count*/, true /* should match */); >+ assertCamelCase("IPL3", "IPerspectiveListener", true /*same part count*/, false /* should not match */); >+ assertCamelCase("IPL3", "IPerspectiveListener2", true /*same part count*/, false /* should not match */); >+ assertCamelCase("IPL3", "IPerspectiveListener3", true /*same part count*/, true /* should match */); >+ assertCamelCase("IPS2", "IPropertySource", true /*same part count*/, false /* should not match */); >+ assertCamelCase("IPS2", "IPropertySource2", true /*same part count*/, true /* should match */); >+ assertCamelCase("IWWPD2", "IWorkbenchWindowPulldownDelegate", true /*same part count*/, false /* should not match */); >+ assertCamelCase("IWWPD2", "IWorkbenchWindowPulldownDelegate2", true /*same part count*/, true /* should match */); >+ assertCamelCase("UTF16DSS", "UTF16DocumentScannerSupport", true /*same part count*/, true /* should match */); >+ assertCamelCase("UTF16DSS", "UTF1DocScannerSupport", true /*same part count*/, false /* should not match */); >+ assertCamelCase("UTF16DSS", "UTF6DocScannerSupport", true /*same part count*/, false /* should not match */); >+ assertCamelCase("UTF16DSS", "UTFDocScannerSupport", true /*same part count*/, false /* should not match */); >+ assertCamelCase("UTF1DSS", "UTF16DocumentScannerSupport", true /*same part count*/, true /* should match */); >+ assertCamelCase("UTF1DSS", "UTF1DocScannerSupport", true /*same part count*/, true /* should match */); >+ assertCamelCase("UTF1DSS", "UTF6DocScannerSupport", true /*same part count*/, false /* should not match */); >+ assertCamelCase("UTF1DSS", "UTFDocScannerSupport", true /*same part count*/, false /* should not match */); >+ assertCamelCase("UTF6DSS", "UTF16DocumentScannerSupport", true /*same part count*/, true /* should match */); >+ assertCamelCase("UTF6DSS", "UTF1DocScannerSupport", true /*same part count*/, false /* should not match */); >+ assertCamelCase("UTF6DSS", "UTF6DocScannerSupport", true /*same part count*/, true /* should match */); >+ assertCamelCase("UTF6DSS", "UTFDocScannerSupport", true /*same part count*/, false /* should not match */); >+ assertCamelCase("UTFDSS", "UTF16DocumentScannerSupport", true /*same part count*/, true /* should match */); >+ assertCamelCase("UTFDSS", "UTF1DocScannerSupport", true /*same part count*/, true /* should match */); >+ assertCamelCase("UTFDSS", "UTF6DocScannerSupport", true /*same part count*/, true /* should match */); >+ assertCamelCase("UTFDSS", "UTFDocScannerSupport", true /*same part count*/, 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 */); >+ assertCamelCase("HM", "HashMap", true /*same count of parts expected*/, true /*should match*/); >+ assertCamelCase("HM", "HtmlMapper", true /*same count of parts expected*/, true /*should match*/); >+ assertCamelCase("HM", "HashMapEntry", true /*same count of parts expected*/, false /* should not match */); >+ assertCamelCase("HaM", "HashMap", true /*same count of parts expected*/, true /* should match */); >+ assertCamelCase("HaM", "HtmlMapper", true /*same count of parts expected*/, false /* should not match */); >+ assertCamelCase("HaM", "HashMapEntry", true /*same count of parts expected*/, false /* should not match */); >+ assertCamelCase("HashM", "HashMap", true /*same count of parts expected*/, true /* should match */); >+ assertCamelCase("HashM", "HtmlMapper", true /*same count of parts expected*/, false /* should not match */); >+ assertCamelCase("HashM", "HashMapEntry", true /*same count of parts expected*/, false /* should not match */); > // Verify that there were no unexpected results > assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0); > } >@@ -686,15 +686,15 @@ > } > // 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 */); >+ assertCamelCase("HMa", "HashMap", true /*same count of parts expected*/, true /* should match */); >+ assertCamelCase("HMa", "HtmlMapper", true /*same count of parts expected*/, true /* should match */); >+ assertCamelCase("HMa", "HashMapEntry", true /*same count of parts expected*/, false /* should not match */); >+ assertCamelCase("HaMa", "HashMap", true /*same count of parts expected*/, true /* should match */); >+ assertCamelCase("HaMa", "HtmlMapper", true /*same count of parts expected*/, false /* should not match */); >+ assertCamelCase("HaMa", "HashMapEntry", true /*same count of parts expected*/, false /* should not match */); >+ assertCamelCase("HashMa", "HashMap", true /*same count of parts expected*/, true /* should match */); >+ assertCamelCase("HashMa", "HtmlMapper", true /*same count of parts expected*/, false /* should not match */); >+ assertCamelCase("HashMa", "HashMapEntry", true /*same count of parts expected*/, false /* should not match */); > // Verify that there were no unexpected results > assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0); > } >@@ -713,15 +713,15 @@ > } > // 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 */); >+ assertCamelCase("HMap", "HashMap", true /*same count of parts expected*/, true /*should match*/); >+ assertCamelCase("HMap", "HtmlMapper", true /*same count of parts expected*/, true /* should not match */); >+ assertCamelCase("HMap", "HashMapEntry", true /*same count of parts expected*/, false /* should not match */); >+ assertCamelCase("HaMap", "HashMap", true /*same count of parts expected*/, true /* should match */); >+ assertCamelCase("HaMap", "HtmlMapper", true /*same count of parts expected*/, false /* should not match */); >+ assertCamelCase("HaMap", "HashMapEntry", true /*same count of parts expected*/, false /* should not match */); >+ assertCamelCase("HashMap", "HashMap", true /*same count of parts expected*/, true /* should match */); >+ assertCamelCase("HashMap", "HtmlMapper", true /*same count of parts expected*/, false /* should not match */); >+ assertCamelCase("HashMap", "HashMapEntry", true /*same count of parts expected*/, false /* should not match */); > // Verify that there were no unexpected results > assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0); > }
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 201426
:
79464
|
79465
|
79539
|
79563