File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/codeassist Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -3456,6 +3456,8 @@ private void statementLikeKeywords() {
34563456 (this .toComplete .getParent () instanceof Assignment )
34573457 ||
34583458 (this .toComplete instanceof Assignment )
3459+ ||
3460+ (this .toComplete .getParent () instanceof FieldDeclaration )
34593461 ;
34603462 if (!isExpressionExpected ) {
34613463 keywords .add (Keywords .ASSERT );
@@ -3471,7 +3473,12 @@ private void statementLikeKeywords() {
34713473 keywords .add (Keywords .FINAL );
34723474 keywords .add (Keywords .CLASS );
34733475 }
3474- keywords .add (Keywords .SUPER );
3476+ if (DOMCompletionUtils .findParent (this .toComplete , new int [] { ASTNode .METHOD_DECLARATION }) instanceof MethodDeclaration md
3477+ && (md .resolveBinding () == null || !Flags .isStatic (md .resolveBinding ().getModifiers ()))
3478+ ||
3479+ DOMCompletionUtils .findParent (this .toComplete , new int [] { ASTNode .INITIALIZER }) != null ){
3480+ keywords .add (Keywords .SUPER );
3481+ }
34753482 keywords .add (Keywords .NEW );
34763483
34773484 {
@@ -3488,8 +3495,7 @@ private void statementLikeKeywords() {
34883495 keywords .add (Keywords .INSTANCEOF );
34893496 }
34903497 }
3491-
3492- if (!this .expectedTypes .getExpectedTypes ().isEmpty ()) {
3498+ if (isExpressionExpected ) {
34933499 keywords .add (Keywords .NULL );
34943500 }
34953501 if (DOMCompletionUtils .findParent (this .toComplete ,
You can’t perform that action at this time.
0 commit comments