### 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.428 diff -u -r1.428 CompletionEngine.java --- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 21 Apr 2011 05:43:13 -0000 1.428 +++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 21 Apr 2011 09:37:11 -0000 @@ -2935,8 +2935,7 @@ (CompletionOnQualifiedNameReference) astNode; this.completionToken = ref.completionIdentifier; long completionPosition = ref.sourcePositions[ref.sourcePositions.length - 1]; - this.assistNodeIsInsideCase = assistNodeIsInsideCase(astNode, this.parser.assistNodeParent); - + if (qualifiedBinding.problemId() == ProblemReasons.NotFound) { setSourceAndTokenRange((int) (completionPosition >>> 32), (int) completionPosition); // complete field members with missing fields type @@ -3080,7 +3079,6 @@ this.assistNodeIsSuperType = ref.isSuperType(); this.assistNodeIsExtendedType = assistNodeIsExtendedType(astNode, astNodeParent); this.assistNodeIsInterfaceExcludingAnnotation = assistNodeIsInterfaceExcludingAnnotation(astNode, astNodeParent); - this.assistNodeIsInsideCase = assistNodeIsInsideCase(astNode, astNodeParent); this.completionToken = ref.completionIdentifier; long completionPosition = ref.sourcePositions[ref.tokens.length]; @@ -3141,7 +3139,6 @@ CompletionOnSingleNameReference singleNameReference = (CompletionOnSingleNameReference) astNode; this.completionToken = singleNameReference.token; SwitchStatement switchStatement = astNodeParent instanceof SwitchStatement ? (SwitchStatement) astNodeParent : null; - this.assistNodeIsInsideCase = assistNodeIsInsideCase(astNode, astNodeParent); if (switchStatement != null && switchStatement.expression.resolvedType != null && switchStatement.expression.resolvedType.isEnum()) { @@ -3217,7 +3214,6 @@ this.assistNodeIsSuperType = singleRef.isSuperType(); this.assistNodeIsExtendedType = assistNodeIsExtendedType(astNode, astNodeParent); this.assistNodeIsInterfaceExcludingAnnotation = assistNodeIsInterfaceExcludingAnnotation(astNode, astNodeParent); - this.assistNodeIsInsideCase = assistNodeIsInsideCase(astNode, astNodeParent); // can be the start of a qualified type name if (qualifiedBinding == null) { @@ -3664,6 +3660,7 @@ } } else if (parent instanceof SwitchStatement) { SwitchStatement switchStatement = (SwitchStatement) parent; + this.assistNodeIsInsideCase = assistNodeIsInsideCase(node, parent); if (switchStatement.expression != null && switchStatement.expression.resolvedType != null) { addExpectedType(switchStatement.expression.resolvedType, scope); @@ -9727,6 +9724,9 @@ if (selector == null && notInJavadoc) { return; } + + if (this.assistNodeIsInsideCase) + return; // no methods should be proposed inside case expression ReferenceBinding currentType = receiverType; if (notInJavadoc) { @@ -11555,7 +11555,7 @@ -1, -1); } - if(proposeMethod && !insideAnnotationAttribute && !this.assistNodeIsInsideCase) { + if(proposeMethod && !insideAnnotationAttribute) { findMethods( token, null, #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/CompletionTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java,v retrieving revision 1.239 diff -u -r1.239 CompletionTests.java --- src/org/eclipse/jdt/core/tests/model/CompletionTests.java 21 Apr 2011 05:43:10 -0000 1.239 +++ src/org/eclipse/jdt/core/tests/model/CompletionTests.java 21 Apr 2011 09:37:12 -0000 @@ -23026,6 +23026,7 @@ " public static final int[] ZZZ5 = null;\n" + " public static final Object[] ZZZ6 = null;\n" + " public static final short ZZZ7 = 0;\n" + + " public static int ZZZMethod(){ return 1;}\n" + " int ZZZ8(){return 1;}\n" + " void foo(int i){\n" + " final int ZZZ01 = 1;\n" +