2424import org .eclipse .jdt .core .dom .EnumConstantDeclaration ;
2525import org .eclipse .jdt .core .dom .EnumDeclaration ;
2626import org .eclipse .jdt .core .dom .Expression ;
27+ import org .eclipse .jdt .core .dom .ExpressionStatement ;
2728import org .eclipse .jdt .core .dom .FieldAccess ;
2829import org .eclipse .jdt .core .dom .FieldDeclaration ;
2930import org .eclipse .jdt .core .dom .IBinding ;
5556import org .eclipse .jdt .core .dom .TypeDeclarationStatement ;
5657import org .eclipse .jdt .core .dom .TypeLiteral ;
5758import org .eclipse .jdt .core .dom .VariableDeclarationFragment ;
58- import org .eclipse .jdt .core .dom .PrimitiveType .Code ;
5959
6060public class ASTScriptVisitor extends ASTKeywordParser {
6161
@@ -1370,6 +1370,17 @@ public boolean visit(MethodDeclaration node) {
13701370 argsList = superRet .arguments ();
13711371 }
13721372 }
1373+ } else if (statement instanceof ExpressionStatement ) {
1374+ ExpressionStatement sttmt = (ExpressionStatement ) statement ;
1375+ Expression exp = sttmt .getExpression ();
1376+ if (exp instanceof SuperMethodInvocation ) {
1377+ SuperMethodInvocation superRet = (SuperMethodInvocation ) exp ;
1378+ if (superRet .getName ().toString ().equals (node .getName ().toString ())) {
1379+ // same method name
1380+ needToCheckArgs = true ;
1381+ argsList = superRet .arguments ();
1382+ }
1383+ }
13731384 } else if (statement instanceof SuperConstructorInvocation ) {
13741385 SuperConstructorInvocation superConstructor = (SuperConstructorInvocation ) statement ;
13751386 needToCheckArgs = true ;
@@ -1394,6 +1405,9 @@ public boolean visit(MethodDeclaration node) {
13941405 isOnlySuper = false ;
13951406 break ;
13961407 }
1408+ } else {
1409+ isOnlySuper = false ;
1410+ break ;
13971411 }
13981412 }
13991413 if (isOnlySuper ) {
0 commit comments