### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v retrieving revision 1.393 diff -u -r1.393 CompletionEngine.java --- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 14 Apr 2009 13:57:11 -0000 1.393 +++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 16 Apr 2009 08:54:23 -0000 @@ -7089,8 +7089,8 @@ if(proposeMethod && !insideAnnotationAttribute) { MethodBinding methodBinding = (MethodBinding)binding; if ((exactMatch && CharOperation.equals(token, methodBinding.selector)) || - !exactMatch && CharOperation.prefixEquals(token, methodBinding.selector)) { - + !exactMatch && CharOperation.prefixEquals(token, methodBinding.selector) || + (this.options.camelCaseMatch && CharOperation.camelCaseMatch(token, methodBinding.selector))) { findLocalMethodsFromStaticImports( methodBinding.selector, methodBinding.declaringClass.methods(), #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java,v retrieving revision 1.112 diff -u -r1.112 CompletionTests_1_5.java --- src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 4 Mar 2009 11:57:11 -0000 1.112 +++ src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 16 Apr 2009 08:54:44 -0000 @@ -13576,5 +13576,47 @@ "ThisClassIsNotFinal[TYPE_REF]{ThisClassIsNotFinal, test, Ltest.ThisClassIsNotFinal;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", requestor.getResults()); } +/* + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=246832 + * To test whether camel case completion works for imported static methods + */ +public void testCamelCaseStaticMethodImport() throws JavaModelException { + this.oldOptions = JavaCore.getOptions(); + this.workingCopies = new ICompilationUnit[2]; + try { + Hashtable options = new Hashtable(this.oldOptions); + options.put(JavaCore.CODEASSIST_CAMEL_CASE_MATCH, JavaCore.ENABLED); + JavaCore.setOptions(options); + + this.workingCopies[0] = getWorkingCopy( + "/Completion/src/a/A.java", + "package a;\n" + + "public class A{\n" + + "public static void testMethodWithLongName(){}\n" + + "}}"); + + this.workingCopies[1] = getWorkingCopy( + "/Completion/src/b/B.java", + "import static a.A.testMethodWithLongName;\n" + + "public class B {\n" + + "public void b() {\n" + + "tMWLN \n" + + "}}"); + + CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2( + true); + String str = this.workingCopies[1].getSource(); + String completeBehind = "tMWLN"; + int cursorLocation = str.indexOf(completeBehind) + completeBehind.length(); + this.workingCopies[1].codeComplete(cursorLocation, requestor, this.wcOwner); + + assertResults( + "testMethodWithLongName[METHOD_REF]{testMethodWithLongName(), La.A;, ()V, testMethodWithLongName, null, " + + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_ENUM_CONSTANT + R_QUALIFIED + R_NON_RESTRICTED) + + "}", requestor.getResults()); + } finally { + JavaCore.setOptions(this.oldOptions); + } +} }