Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Honnen2020-05-25 13:31:40 +0000
committerJulian Honnen2020-07-02 12:00:50 +0000
commit426eda83ab55bcae1ac579d54780ff57822b5a3c (patch)
tree59a8c6933025b1af49899146170202abbed31036
parent10e442027167d5d572e303e308b542c97e6ef3e6 (diff)
downloadeclipse.jdt.core-426eda83ab55bcae1ac579d54780ff57822b5a3c.tar.gz
eclipse.jdt.core-426eda83ab55bcae1ac579d54780ff57822b5a3c.tar.xz
eclipse.jdt.core-426eda83ab55bcae1ac579d54780ff57822b5a3c.zip
Bug 481323 - support substring and subword matching in findTypes
Substring matching is always enabled and can only be disabled by the existing VM arg -Djdt.codeCompleteSubstringMatch=false. Subword matching is enabled by default and can be disabled with the existing preference. Modified SearchableEnvironment, SearchPattern, Index and BasicSearchEngine to support match rules with any combination of exact type, camel case, substring and subword matches for types. In Substring/SubwordCompletionTests all java.* type proposals are ignored. The intention is to avoid test maintenance when new types with similar names are added to the JDK (e.g. CyclicBarrier is now a match for "bar"). Change-Id: Ie51b96f0b20025001b7babcaf5aff1637bc0922e Signed-off-by: Julian Honnen <julian.honnen@vector.com>
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java9
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubstringCompletionTests.java191
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubwordCompletionTests.java174
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java21
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/CorrectionEngine.java1
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java15
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java16
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/Index.java15
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java6
10 files changed, 280 insertions, 172 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java
index fbfef08d21..6eb59dfa22 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java
@@ -15,6 +15,7 @@ package org.eclipse.jdt.core.tests.model;
import java.util.Arrays;
import java.util.Comparator;
+import java.util.function.Predicate;
import org.eclipse.jdt.core.CompletionContext;
import org.eclipse.jdt.core.CompletionProposal;
@@ -52,6 +53,8 @@ public class CompletionTestsRequestor2 extends CompletionRequestor {
public boolean debug = false;
+ private Predicate<CompletionProposal> proposalFilter = x -> true;
+
public CompletionTestsRequestor2() {
this(false, false);
}
@@ -96,6 +99,9 @@ public class CompletionTestsRequestor2 extends CompletionRequestor {
this.context = cc;
}
public void accept(CompletionProposal proposal) {
+ if (!this.proposalFilter.test(proposal))
+ return;
+
int length = this.proposals.length;
if (++this.proposalsPtr== length) {
System.arraycopy(this.proposals, 0, this.proposals = new CompletionProposal[length+PROPOSALS_INCREMENT], 0, length);
@@ -625,6 +631,9 @@ public class CompletionTestsRequestor2 extends CompletionRequestor {
public void setComputeEnclosingElement(boolean computeEnclosingElement) {
this.computeEnclosingElement = computeEnclosingElement;
}
+ public void setProposalFilter(Predicate<CompletionProposal> proposalFilter) {
+ this.proposalFilter = proposalFilter;
+ }
public boolean canUseDiamond(int proposalNo) {
if (proposalNo < this.proposals.length && this.proposals[proposalNo] != null) {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubstringCompletionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubstringCompletionTests.java
index f6707a225c..0da17e690b 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubstringCompletionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubstringCompletionTests.java
@@ -13,6 +13,9 @@
*******************************************************************************/
package org.eclipse.jdt.core.tests.model;
+import java.util.function.Predicate;
+
+import org.eclipse.jdt.core.CompletionProposal;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.codeassist.impl.AssistOptions;
@@ -53,7 +56,12 @@ public void tearDownSuite() throws Exception {
}
super.tearDownSuite();
}
-
+private CompletionTestsRequestor2 createFilteredRequestor() {
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ Predicate<CompletionProposal> javaTypeRef = p -> p.getKind() == CompletionProposal.TYPE_REF && new String(p.getSignature()).startsWith("Ljava.");
+ requestor.setProposalFilter(javaTypeRef.negate());
+ return requestor;
+}
public void testQualifiedNonStaticMethod() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -68,7 +76,7 @@ public void testQualifiedNonStaticMethod() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "this.bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -95,7 +103,7 @@ public void testUnqualifiedNonStaticMethod() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -121,7 +129,7 @@ public void testQualifiedStaticMethod() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "Test.bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -146,7 +154,7 @@ public void testUnqualifiedStaticMethod() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "Bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -172,7 +180,7 @@ public void testQualifiedNonStaticField() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "this.item";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -199,7 +207,7 @@ public void testUnqualifiedNonStaticField() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "item";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -225,7 +233,7 @@ public void testQualifiedStaticField() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "Test.item";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -250,7 +258,7 @@ public void testUnqualifiedStaticField() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "item";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -277,7 +285,7 @@ public void testLocalVariable() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "item";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -304,7 +312,7 @@ public void testMethodParamVariable() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "item";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -318,48 +326,54 @@ public void testMethodParamVariable() throws JavaModelException {
requestor.getResults());
}
public void testClassTypeInstantiation() throws JavaModelException {
- this.workingCopies = new ICompilationUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.java",
- "package test;"+
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src/test/Foobar.java",
+ "package test;\n"+
"interface Foobar {}\n" +
"class SpecificFooBar implements Foobar {}\n" +
"class EvenMoreSpecificFooBar extends SpecificFooBar {}\n" +
"interface Foobaz {}\n" +
- "class SpecificFooBaz implements Foobaz {}\n" +
+ "class SpecificFooBaz implements Foobaz {}\n");
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/Test.java",
+ "package test;"+
"public class Test {\n" +
" {\n" +
" Foobar f = new bar\n" +
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "new bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "EvenMoreSpecificFooBar[TYPE_REF]{EvenMoreSpecificFooBar, test, Ltest.EvenMoreSpecificFooBar;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED + R_SUBSTRING) + "}\n" +
- "SpecificFooBar[TYPE_REF]{SpecificFooBar, test, Ltest.SpecificFooBar;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED + R_SUBSTRING) + "}\n" +
+ "EvenMoreSpecificFooBar[TYPE_REF]{EvenMoreSpecificFooBar, test, Ltest.EvenMoreSpecificFooBar;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED + R_SUBSTRING) + "}\n" +
+ "SpecificFooBar[TYPE_REF]{SpecificFooBar, test, Ltest.SpecificFooBar;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED + R_SUBSTRING) + "}\n" +
"Foobar[TYPE_REF]{Foobar, test, Ltest.Foobar;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED + R_SUBSTRING) + "}",
requestor.getResults());
}
public void testClassTypeFieldDeclaration() throws JavaModelException {
- this.workingCopies = new ICompilationUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.java",
- "package test;"+
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src/test/Foobar.java",
+ "package test;\n"+
"interface Foobar {}\n" +
"class SpecificFooBar implements Foobar {}\n" +
"class EvenMoreSpecificFooBar extends SpecificFooBar {}\n" +
"interface Foobaz {}\n" +
- "class SpecificFooBaz implements Foobaz {}\n" +
+ "class SpecificFooBaz implements Foobaz {}\n");
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/Test.java",
+ "package test;"+
"public class Test {\n" +
" public bar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "public bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -372,20 +386,23 @@ public void testClassTypeFieldDeclaration() throws JavaModelException {
requestor.getResults());
}
public void testClassTypeParamDeclaration() throws JavaModelException {
- this.workingCopies = new ICompilationUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.java",
- "package test;"+
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src/test/Foobar.java",
+ "package test;\n"+
"interface Foobar {}\n" +
"class SpecificFooBar implements Foobar {}\n" +
"class EvenMoreSpecificFooBar extends SpecificFooBar {}\n" +
"interface Foobaz {}\n" +
- "class SpecificFooBaz implements Foobaz {}\n" +
+ "class SpecificFooBaz implements Foobaz {}\n");
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/Test.java",
+ "package test;"+
"public class Test {\n" +
" void setFoo(bar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "void setFoo(bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -398,22 +415,25 @@ public void testClassTypeParamDeclaration() throws JavaModelException {
requestor.getResults());
}
public void testClassTypeLocalVarDeclaration() throws JavaModelException {
- this.workingCopies = new ICompilationUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.java",
- "package test;"+
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src/test/Foobar.java",
+ "package test;\n"+
"interface Foobar {}\n" +
"class SpecificFooBar implements Foobar {}\n" +
"class EvenMoreSpecificFooBar extends SpecificFooBar {}\n" +
"interface Foobaz {}\n" +
- "class SpecificFooBaz implements Foobaz {}\n" +
+ "class SpecificFooBaz implements Foobaz {}\n");
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/Test.java",
+ "package test;"+
"public class Test {\n" +
" void foo() {\n" +
" final bar" +
" }" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "final bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -426,21 +446,24 @@ public void testClassTypeLocalVarDeclaration() throws JavaModelException {
requestor.getResults());
}
public void testClassTypeThrowsDeclaration() throws JavaModelException {
- this.workingCopies = new ICompilationUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.java",
- "package test;"+
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src/test/Foobar.java",
+ "package test;\n"+
"interface Foobar {}\n" +
- "class SpecificFooBar implements Foobar extends Exception {}\n" +
+ "class SpecificFooBar implements Foobar {}\n" +
"class EvenMoreSpecificFooBar extends SpecificFooBar {}\n" +
"interface Foobaz {}\n" +
- "class SpecificFooBaz implements Foobaz extends Exception {}\n" +
+ "class SpecificFooBaz implements Foobaz {}\n");
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/Test.java",
+ "package test;"+
"public class Test {\n" +
" void foo() throws bar {\n" +
" }" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "void foo() throws bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -452,20 +475,23 @@ public void testClassTypeThrowsDeclaration() throws JavaModelException {
requestor.getResults());
}
public void testClassTypeExtends() throws JavaModelException {
- this.workingCopies = new ICompilationUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.java",
- "package test;"+
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src/test/Foobar.java",
+ "package test;\n"+
"interface Foobar {}\n" +
"class SpecificFooBar implements Foobar {}\n" +
"class EvenMoreSpecificFooBar extends SpecificFooBar {}\n" +
"interface Foobaz {}\n" +
- "class SpecificFooBaz implements Foobaz {}\n" +
+ "class SpecificFooBaz implements Foobaz {}\n");
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/Test.java",
+ "package test;"+
"public class Test extends bar {\n" +
" }" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "public class Test extends bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -477,21 +503,24 @@ public void testClassTypeExtends() throws JavaModelException {
requestor.getResults());
}
public void testClassTypeImplements() throws JavaModelException {
- this.workingCopies = new ICompilationUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.java",
- "package test;"+
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src/test/Foobar.java",
+ "package test;\n"+
"interface Foobar {}\n" +
"interface FoobarExtension extends Foobar {}\n" +
"class SpecificFooBar implements Foobar {}\n" +
"class EvenMoreSpecificFooBar extends SpecificFooBar {}\n" +
"interface Foobaz {}\n" +
- "class SpecificFooBaz implements Foobaz {}\n" +
+ "class SpecificFooBaz implements Foobaz {}\n");
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/Test.java",
+ "package test;"+
"public class Test implements bar {\n" +
" }" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "public class Test implements bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -515,7 +544,7 @@ public void testInnerClassTypeInstantiation() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "t.new bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -535,7 +564,7 @@ public void testInnerClassTypeFieldDeclaration() throws JavaModelException {
" public bar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "public bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -555,7 +584,7 @@ public void testInnerClassTypeParamDeclaration() throws JavaModelException {
" void foo(bar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "void foo(bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -577,7 +606,7 @@ public void testInnerClassTypeLocalVarDeclaration() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "final bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -597,7 +626,7 @@ public void testInnerClassTypeThrowsDeclaration() throws JavaModelException {
" void foo() throws bar" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "void foo() throws bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -617,7 +646,7 @@ public void testInnerClassTypeExtends() throws JavaModelException {
" class SpecificFooBar extends bar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "SpecificFooBar extends bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -637,7 +666,7 @@ public void testInnerClassTypeImplements() throws JavaModelException {
" class SpecificFooBar implements bar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "class SpecificFooBar implements bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -659,7 +688,7 @@ public void testStaticNestedClassTypeInstantiation() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "new bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -679,7 +708,7 @@ public void testStaticNestedClassTypeFieldDeclaration() throws JavaModelExceptio
" public bar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "public bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -699,7 +728,7 @@ public void testStaticNestedClassTypeParamDeclaration() throws JavaModelExceptio
" void foo(bar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "void foo(bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -721,7 +750,7 @@ public void testStaticNestedClassTypeLocalVarDeclaration() throws JavaModelExcep
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "final bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -741,7 +770,7 @@ public void testStaticNestedClassTypeThrowsDeclaration() throws JavaModelExcepti
" void foo() throws bar" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "void foo() throws bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -761,7 +790,7 @@ public void testStaticNestedClassTypeExtends() throws JavaModelException {
" class SpecificFooBar extends bar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "SpecificFooBar extends bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -781,7 +810,7 @@ public void testStaticNestedClassTypeImplements() throws JavaModelException {
" class SpecificFooBar implements bar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "class SpecificFooBar implements bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -803,7 +832,7 @@ public void testLocalClassTypeInstantiation() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "new bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -825,7 +854,7 @@ public void testLocalClassTypeLocalVarDeclaration() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "final bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -847,7 +876,7 @@ public void testLocalClassTypeExtends() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "class SpecificFooBar extends bar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -868,7 +897,7 @@ public void testBug488441_1() throws JavaModelException {
this.workingCopies[0] = getWorkingCopy(
"/Completion/src/test/Test.java",
content);
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = ".st";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -898,7 +927,7 @@ public void testBug488441_2() throws JavaModelException {
"/Completion/src/test/Test.java",
content);
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = ".st";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -928,7 +957,7 @@ public void testBug488441_3() throws JavaModelException {
"/Completion/src/test/Test.java",
content);
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = ".st";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -958,7 +987,7 @@ public void testBug488441_4() throws JavaModelException {
"/Completion/src/test/Test.java",
content);
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = ".st";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -990,7 +1019,7 @@ public void testBug488441_5() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = ".as";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -1023,7 +1052,7 @@ public void testBug488441_6() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = ".aS";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -1056,7 +1085,7 @@ public void testBug488441_7() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = ".as";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -1089,7 +1118,7 @@ public void testBug488441_8() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = ".as";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubwordCompletionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubwordCompletionTests.java
index b73ae952d6..d3773047b8 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubwordCompletionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubwordCompletionTests.java
@@ -14,7 +14,9 @@
package org.eclipse.jdt.core.tests.model;
import java.util.Hashtable;
+import java.util.function.Predicate;
+import org.eclipse.jdt.core.CompletionProposal;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
@@ -55,7 +57,12 @@ public void tearDownSuite() throws Exception {
}
super.tearDownSuite();
}
-
+private CompletionTestsRequestor2 createFilteredRequestor() {
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ Predicate<CompletionProposal> javaTypeRef = p -> p.getKind() == CompletionProposal.TYPE_REF && new String(p.getSignature()).startsWith("Ljava.");
+ requestor.setProposalFilter(javaTypeRef.negate());
+ return requestor;
+}
public void testQualifiedNonStaticMethod() throws JavaModelException {
this.workingCopies = new ICompilationUnit[1];
this.workingCopies[0] = getWorkingCopy(
@@ -70,7 +77,7 @@ public void testQualifiedNonStaticMethod() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "this.addlistener";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -97,7 +104,7 @@ public void testUnqualifiedNonStaticMethod() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "addlistener";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -123,7 +130,7 @@ public void testQualifiedStaticMethod() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "Test.addlistener";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -148,7 +155,7 @@ public void testUnqualifiedStaticMethod() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "addlistener";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -174,7 +181,7 @@ public void testQualifiedNonStaticField() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "this.fitem";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -201,7 +208,7 @@ public void testUnqualifiedNonStaticField() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "fitem";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -227,7 +234,7 @@ public void testQualifiedStaticField() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "Test.sitem";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -252,7 +259,7 @@ public void testUnqualifiedStaticField() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "sitem";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -279,7 +286,7 @@ public void testLocalVariable() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "tempitem";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -304,7 +311,7 @@ public void testMethodParamVariable() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "item";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -316,47 +323,53 @@ public void testMethodParamVariable() throws JavaModelException {
requestor.getResults());
}
public void testClassTypeInstantiation() throws JavaModelException {
- this.workingCopies = new ICompilationUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.java",
- "package test;"+
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src/test/Foobar.java",
+ "package test;\n"+
"interface Map {}\n" +
"class LinkedHashMap implements Map {}\n" +
"class SpecificLinkedHashMap extends LinkedHashMap {}\n" +
"interface Foobaz {}\n" +
- "class SpecificFooBaz implements Foobaz {}\n" +
+ "class SpecificFooBaz implements Foobaz {}\n");
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/Test.java",
+ "package test;"+
"public class Test {\n" +
" {\n" +
" Map f = new linkedmap\n" +
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "new linkedmap";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "LinkedHashMap[TYPE_REF]{LinkedHashMap, test, Ltest.LinkedHashMap;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED + R_SUBWORD) + "}\n" +
- "SpecificLinkedHashMap[TYPE_REF]{SpecificLinkedHashMap, test, Ltest.SpecificLinkedHashMap;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED + R_SUBWORD) + "}",
+ "LinkedHashMap[TYPE_REF]{LinkedHashMap, test, Ltest.LinkedHashMap;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED + R_SUBWORD) + "}\n" +
+ "SpecificLinkedHashMap[TYPE_REF]{SpecificLinkedHashMap, test, Ltest.SpecificLinkedHashMap;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED + R_SUBWORD) + "}",
requestor.getResults());
}
public void testClassTypeFieldDeclaration() throws JavaModelException {
- this.workingCopies = new ICompilationUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.java",
- "package test;"+
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src/test/Foobar.java",
+ "package test;\n"+
"interface Map {}\n" +
"class LinkedHashMap implements Map {}\n" +
"class SpecificLinkedHashMap extends LinkedHashMap {}\n" +
"interface Foobaz {}\n" +
- "class SpecificFooBaz implements Foobaz {}\n" +
+ "class SpecificFooBaz implements Foobaz {}\n");
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/Test.java",
+ "package test;"+
"public class Test {\n" +
" public linkedmap\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "public linkedmap";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -368,20 +381,23 @@ public void testClassTypeFieldDeclaration() throws JavaModelException {
requestor.getResults());
}
public void testClassTypeParamDeclaration() throws JavaModelException {
- this.workingCopies = new ICompilationUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.java",
- "package test;"+
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src/test/Foobar.java",
+ "package test;\n"+
"interface Map {}\n" +
"class LinkedHashMap implements Map {}\n" +
"class SpecificLinkedHashMap extends LinkedHashMap {}\n" +
"interface Foobaz {}\n" +
- "class SpecificFooBaz implements Foobaz {}\n" +
+ "class SpecificFooBaz implements Foobaz {}\n");
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/Test.java",
+ "package test;"+
"public class Test {\n" +
" void setFoo(linkedmap\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "void setFoo(linkedmap";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -393,22 +409,25 @@ public void testClassTypeParamDeclaration() throws JavaModelException {
requestor.getResults());
}
public void testClassTypeLocalVarDeclaration() throws JavaModelException {
- this.workingCopies = new ICompilationUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.java",
- "package test;"+
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src/test/Foobar.java",
+ "package test;\n"+
"interface Map {}\n" +
"class LinkedHashMap implements Map {}\n" +
"class SpecificLinkedHashMap extends LinkedHashMap {}\n" +
"interface Foobaz {}\n" +
- "class SpecificFooBaz implements Foobaz {}\n" +
+ "class SpecificFooBaz implements Foobaz {}\n");
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/Test.java",
+ "package test;"+
"public class Test {\n" +
" void foo() {\n" +
" final linkedmap" +
" }" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "final linkedmap";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -420,21 +439,24 @@ public void testClassTypeLocalVarDeclaration() throws JavaModelException {
requestor.getResults());
}
public void testClassTypeThrowsDeclaration() throws JavaModelException {
- this.workingCopies = new ICompilationUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.java",
- "package test;"+
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src/test/Foobar.java",
+ "package test;\n"+
"interface Foobar {}\n" +
"class SpecificFooBar implements Foobar extends Exception {}\n" +
"class EvenMoreSpecificFooBar extends SpecificFooBar {}\n" +
"interface Foobaz {}\n" +
- "class SpecificFooBaz implements Foobaz extends Exception {}\n" +
+ "class SpecificFooBaz implements Foobaz extends Exception {}\n");
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/Test.java",
+ "package test;"+
"public class Test {\n" +
" void foo() throws fbar {\n" +
" }" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "void foo() throws fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -446,20 +468,23 @@ public void testClassTypeThrowsDeclaration() throws JavaModelException {
requestor.getResults());
}
public void testClassTypeExtends() throws JavaModelException {
- this.workingCopies = new ICompilationUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.java",
- "package test;"+
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src/test/Foobar.java",
+ "package test;\n"+
"interface Foobar {}\n" +
"class SpecificFooBar implements Foobar {}\n" +
"class EvenMoreSpecificFooBar extends SpecificFooBar {}\n" +
"interface Foobaz {}\n" +
- "class SpecificFooBaz implements Foobaz {}\n" +
+ "class SpecificFooBaz implements Foobaz {}\n");
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/Test.java",
+ "package test;"+
"public class Test extends fbar {\n" +
" }" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "public class Test extends fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -471,21 +496,24 @@ public void testClassTypeExtends() throws JavaModelException {
requestor.getResults());
}
public void testClassTypeImplements() throws JavaModelException {
- this.workingCopies = new ICompilationUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.java",
- "package test;"+
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src/test/Foobar.java",
+ "package test;\n"+
"interface FooBar {}\n" +
"interface FooBarExtension extends FooBar {}\n" +
"class SpecificFooBar implements FooBar {}\n" +
"class EvenMoreSpecificFooBar extends SpecificFooBar {}\n" +
"interface Foobaz {}\n" +
- "class SpecificFooBaz implements Foobaz {}\n" +
+ "class SpecificFooBaz implements Foobaz {}\n");
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/Test.java",
+ "package test;"+
"public class Test implements fbar {\n" +
" }" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "public class Test implements fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -509,7 +537,7 @@ public void testInnerClassTypeInstantiation() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "t.new fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -529,7 +557,7 @@ public void testInnerClassTypeFieldDeclaration() throws JavaModelException {
" public fbar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "public fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -549,7 +577,7 @@ public void testInnerClassTypeParamDeclaration() throws JavaModelException {
" void foo(fbar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "void foo(fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -571,7 +599,7 @@ public void testInnerClassTypeLocalVarDeclaration() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "final fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -591,7 +619,7 @@ public void testInnerClassTypeThrowsDeclaration() throws JavaModelException {
" void foo() throws fbar" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "void foo() throws fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -611,7 +639,7 @@ public void testInnerClassTypeExtends() throws JavaModelException {
" class SpecificFooBar extends fbar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "SpecificFooBar extends fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -631,7 +659,7 @@ public void testInnerClassTypeImplements() throws JavaModelException {
" class SpecificFooBar implements fbar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "class SpecificFooBar implements fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -653,7 +681,7 @@ public void testStaticNestedClassTypeInstantiation() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "new fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -673,7 +701,7 @@ public void testStaticNestedClassTypeFieldDeclaration() throws JavaModelExceptio
" public fbar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "public fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -693,7 +721,7 @@ public void testStaticNestedClassTypeParamDeclaration() throws JavaModelExceptio
" void foo(fbar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "void foo(fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -715,7 +743,7 @@ public void testStaticNestedClassTypeLocalVarDeclaration() throws JavaModelExcep
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "final fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -735,7 +763,7 @@ public void testStaticNestedClassTypeThrowsDeclaration() throws JavaModelExcepti
" void foo() throws fbar" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "void foo() throws fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -755,7 +783,7 @@ public void testStaticNestedClassTypeExtends() throws JavaModelException {
" class SpecificFooBar extends fbar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "SpecificFooBar extends fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -775,7 +803,7 @@ public void testStaticNestedClassTypeImplements() throws JavaModelException {
" class SpecificFooBar implements fbar\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "class SpecificFooBar implements fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -797,7 +825,7 @@ public void testLocalClassTypeInstantiation() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "new fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -819,7 +847,7 @@ public void testLocalClassTypeLocalVarDeclaration() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "final fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -841,7 +869,7 @@ public void testLocalClassTypeExtends() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "class SpecificFooBar extends fbar";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
@@ -862,7 +890,7 @@ public void testDontPreventInsertionOfExactMatch() throws JavaModelException {
" }\n" +
"}\n");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = createFilteredRequestor();
String str = this.workingCopies[0].getSource();
String completeBehind = "map.put(";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
index ca7cf663cd..afffe434a9 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
@@ -8266,7 +8266,7 @@ public final class CompletionEngine
this.nameEnvironment.findTypes(
importName,
findMembers,
- this.options.camelCaseMatch,
+ getTypesMatchRule(),
IJavaSearchConstants.TYPE,
this,
this.monitor);
@@ -11295,7 +11295,7 @@ public final class CompletionEngine
this.foundConstructorsCount = 0;
this.nameEnvironment.findConstructorDeclarations(
token,
- this.options.camelCaseMatch,
+ getTypesMatchRule(),
this,
this.monitor);
acceptConstructors(scope);
@@ -11329,7 +11329,7 @@ public final class CompletionEngine
this.nameEnvironment.findTypes(
token,
proposeAllMemberTypes,
- this.options.camelCaseMatch,
+ getTypesMatchRule(),
searchFor,
this,
this.monitor);
@@ -11344,6 +11344,17 @@ public final class CompletionEngine
}
}
+ private int getTypesMatchRule() {
+ int matchRule = SearchPattern.R_PREFIX_MATCH;
+ if (this.options.camelCaseMatch)
+ matchRule |= SearchPattern.R_CAMELCASE_MATCH;
+ if (this.options.substringMatch)
+ matchRule |= SearchPattern.R_SUBSTRING_MATCH;
+ if (this.options.subwordMatch)
+ matchRule |= SearchPattern.R_SUBWORD_MATCH;
+ return matchRule;
+ }
+
private void findTypesAndSubpackages(
char[] token,
PackageBinding packageBinding,
@@ -11487,7 +11498,7 @@ public final class CompletionEngine
this.foundConstructorsCount = 0;
this.nameEnvironment.findConstructorDeclarations(
qualifiedName,
- this.options.camelCaseMatch,
+ getTypesMatchRule(),
this,
this.monitor);
acceptConstructors(scope);
@@ -11511,7 +11522,7 @@ public final class CompletionEngine
this.nameEnvironment.findTypes(
qualifiedName,
false,
- this.options.camelCaseMatch,
+ getTypesMatchRule(),
searchFor,
this,
this.monitor);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CorrectionEngine.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CorrectionEngine.java
index 3d97ca1ede..c03eb13fd8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CorrectionEngine.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CorrectionEngine.java
@@ -297,6 +297,7 @@ public class CorrectionEngine {
try {
Hashtable options = new Hashtable(oldOptions);
options.put(JavaCore.CODEASSIST_CAMEL_CASE_MATCH, JavaCore.DISABLED);
+ options.put(JavaCore.CODEASSIST_SUBWORD_MATCH, JavaCore.DISABLED);
JavaCore.setOptions(options);
this.compilationUnit.codeComplete(
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java
index fa12a481c4..be24056aac 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java
@@ -63,9 +63,9 @@ public class CancelableNameEnvironment extends SearchableEnvironment implements
return findType(typeName, packageName, moduleName);
}
@Override
- public void findTypes(char[] prefix, boolean findMembers, boolean camelCaseMatch, int searchFor, ISearchRequestor storage, IProgressMonitor progressMonitor) {
+ public void findTypes(char[] prefix, boolean findMembers, int matchRule, int searchFor, ISearchRequestor storage, IProgressMonitor progressMonitor) {
checkCanceled();
- super.findTypes(prefix, findMembers, camelCaseMatch, searchFor, storage, progressMonitor);
+ super.findTypes(prefix, findMembers, matchRule, searchFor, storage, progressMonitor);
}
@Override
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java
index 1fe4af8f9a..706b2740d8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java
@@ -497,7 +497,7 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
* types are found relative to their enclosing type.
*/
public void findTypes(char[] prefix, final boolean findMembers, boolean camelCaseMatch, int searchFor, final ISearchRequestor storage) {
- findTypes(prefix, findMembers, camelCaseMatch, searchFor, storage, null);
+ findTypes(prefix, findMembers, camelCaseMatch ? SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CAMELCASE_MATCH : SearchPattern.R_PREFIX_MATCH, searchFor, storage, null);
}
/**
* Must be used only by CompletionEngine.
@@ -517,8 +517,8 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
* This method can not be used to find member types... member
* types are found relative to their enclosing type.
*/
- public void findTypes(char[] prefix, final boolean findMembers, boolean camelCaseMatch, int searchFor, final ISearchRequestor storage, IProgressMonitor monitor) {
-
+ public void findTypes(char[] prefix, final boolean findMembers, int matchRule, int searchFor, final ISearchRequestor storage, IProgressMonitor monitor) {
+ boolean camelCaseMatch = (matchRule & SearchPattern.R_CAMELCASE_MATCH) != 0;
/*
if (true){
findTypes(new String(prefix), storage, NameLookup.ACCEPT_CLASSES | NameLookup.ACCEPT_INTERFACES);
@@ -606,8 +606,6 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
}
};
- int matchRule = SearchPattern.R_PREFIX_MATCH;
- if (camelCaseMatch) matchRule |= SearchPattern.R_CAMELCASE_MATCH;
if (monitor != null) {
IndexManager indexManager = JavaModelManager.getIndexManager();
if (indexManager.awaitingJobsCount() == 0) {
@@ -638,7 +636,7 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
qualification,
SearchPattern.R_EXACT_MATCH,
simpleName,
- matchRule, // not case sensitive
+ matchRule,
searchFor,
getSearchScope(),
typeRequestor,
@@ -691,7 +689,7 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
* The constructors found are passed to one of the following methods:
* ISearchRequestor.acceptConstructor(...)
*/
- public void findConstructorDeclarations(char[] prefix, boolean camelCaseMatch, final ISearchRequestor storage, IProgressMonitor monitor) {
+ public void findConstructorDeclarations(char[] prefix, int matchRule, final ISearchRequestor storage, IProgressMonitor monitor) {
try {
final String excludePath;
if (this.unitToSkip != null && this.unitToSkip instanceof IJavaElement) {
@@ -701,6 +699,7 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
}
int lastDotIndex = CharOperation.lastIndexOf('.', prefix);
+ boolean camelCaseMatch = (matchRule & SearchPattern.R_CAMELCASE_MATCH) != 0;
char[] qualification, simpleName;
if (lastDotIndex < 0) {
qualification = null;
@@ -788,8 +787,6 @@ private void findPackagesFromRequires(char[] prefix, boolean isMatchAllPrefix, I
}
};
- int matchRule = SearchPattern.R_PREFIX_MATCH;
- if (camelCaseMatch) matchRule |= SearchPattern.R_CAMELCASE_MATCH;
if (monitor != null) {
IndexManager indexManager = JavaModelManager.getIndexManager();
// Wait for the end of indexing or a cancel
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java
index 28b5a6ef9d..7063275d5d 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java
@@ -253,7 +253,9 @@ public abstract class SearchPattern {
| R_PATTERN_MATCH
| R_REGEXP_MATCH
| R_CAMELCASE_MATCH
- | R_CAMELCASE_SAME_PART_COUNT_MATCH;
+ | R_CAMELCASE_SAME_PART_COUNT_MATCH
+ | R_SUBSTRING_MATCH
+ | R_SUBWORD_MATCH;
private int matchRule;
@@ -2527,6 +2529,18 @@ public boolean matchesName(char[] pattern, char[] name) {
boolean sameLength = pattern.length == name.length;
boolean canBePrefix = name.length >= pattern.length;
boolean matchFirstChar = !isCaseSensitive || emptyPattern || (name.length > 0 && pattern[0] == name[0]);
+
+ if ((matchMode & R_SUBSTRING_MATCH) != 0) {
+ if (CharOperation.substringMatch(pattern, name))
+ return true;
+ matchMode &= ~R_SUBSTRING_MATCH;
+ }
+ if ((matchMode & SearchPattern.R_SUBWORD_MATCH) != 0) {
+ if (CharOperation.subWordMatch(pattern, name))
+ return true;
+ matchMode &= ~SearchPattern.R_SUBWORD_MATCH;
+ }
+
switch (matchMode) {
case R_EXACT_MATCH :
if (sameLength && matchFirstChar) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/Index.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/Index.java
index 7a333cb356..93cb3e7850 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/Index.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/Index.java
@@ -52,7 +52,9 @@ static final int MATCH_RULE_INDEX_MASK =
SearchPattern.R_REGEXP_MATCH |
SearchPattern.R_CASE_SENSITIVE |
SearchPattern.R_CAMELCASE_MATCH |
- SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH;
+ SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH |
+ SearchPattern.R_SUBSTRING_MATCH |
+ SearchPattern.R_SUBWORD_MATCH;
public static boolean isMatch(char[] pattern, char[] word, int matchRule) {
if (pattern == null) return true;
@@ -61,6 +63,17 @@ public static boolean isMatch(char[] pattern, char[] word, int matchRule) {
if (patternLength == 0) return matchRule != SearchPattern.R_EXACT_MATCH;
if (wordLength == 0) return (matchRule & SearchPattern.R_PATTERN_MATCH) != 0 && patternLength == 1 && pattern[0] == '*';
+ if ((matchRule & SearchPattern.R_SUBSTRING_MATCH) != 0) {
+ if (CharOperation.substringMatch(pattern, word))
+ return true;
+ matchRule &= ~SearchPattern.R_SUBSTRING_MATCH;
+ }
+ if ((matchRule & SearchPattern.R_SUBWORD_MATCH) != 0) {
+ if (CharOperation.subWordMatch(pattern, word))
+ return true;
+ matchRule &= ~SearchPattern.R_SUBWORD_MATCH;
+ }
+
// need to mask some bits of pattern rule (bug 79790)
switch(matchRule & MATCH_RULE_INDEX_MASK) {
case SearchPattern.R_EXACT_MATCH :
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java
index ea1f5e69ea..d351cf2dae 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java
@@ -492,6 +492,12 @@ public class BasicSearchEngine {
boolean isCaseSensitive = (matchRuleType & SearchPattern.R_CASE_SENSITIVE) != 0;
if (patternTypeName != null) {
boolean isCamelCase = (matchRuleType & (SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH)) != 0;
+
+ if ((matchRuleType & SearchPattern.R_SUBSTRING_MATCH) != 0 && CharOperation.substringMatch(patternTypeName, typeName))
+ return true;
+ if ((matchRuleType & SearchPattern.R_SUBWORD_MATCH) != 0 && CharOperation.subWordMatch(patternTypeName, typeName))
+ return true;
+
int matchMode = matchRuleType & JavaSearchPattern.MATCH_MODE_MASK;
if (!isCaseSensitive && !isCamelCase) {
patternTypeName = CharOperation.toLowerCase(patternTypeName);

Back to the top