24
24
import org .eclipse .jdt .core .dom .EnumConstantDeclaration ;
25
25
import org .eclipse .jdt .core .dom .EnumDeclaration ;
26
26
import org .eclipse .jdt .core .dom .Expression ;
27
+ import org .eclipse .jdt .core .dom .ExpressionStatement ;
27
28
import org .eclipse .jdt .core .dom .FieldAccess ;
28
29
import org .eclipse .jdt .core .dom .FieldDeclaration ;
29
30
import org .eclipse .jdt .core .dom .IBinding ;
55
56
import org .eclipse .jdt .core .dom .TypeDeclarationStatement ;
56
57
import org .eclipse .jdt .core .dom .TypeLiteral ;
57
58
import org .eclipse .jdt .core .dom .VariableDeclarationFragment ;
58
- import org .eclipse .jdt .core .dom .PrimitiveType .Code ;
59
59
60
60
public class ASTScriptVisitor extends ASTKeywordParser {
61
61
@@ -1370,6 +1370,17 @@ public boolean visit(MethodDeclaration node) {
1370
1370
argsList = superRet .arguments ();
1371
1371
}
1372
1372
}
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
+ }
1373
1384
} else if (statement instanceof SuperConstructorInvocation ) {
1374
1385
SuperConstructorInvocation superConstructor = (SuperConstructorInvocation ) statement ;
1375
1386
needToCheckArgs = true ;
@@ -1394,6 +1405,9 @@ public boolean visit(MethodDeclaration node) {
1394
1405
isOnlySuper = false ;
1395
1406
break ;
1396
1407
}
1408
+ } else {
1409
+ isOnlySuper = false ;
1410
+ break ;
1397
1411
}
1398
1412
}
1399
1413
if (isOnlySuper ) {
0 commit comments