Resolve 'this' keyword in Java
This commit is contained in:
1 parent
e75cf1b55c
commit
6fb5681734
1 file changed
+7
-1
+7
-1
@@ -456,7 +456,13 @@ public class ClassTypeResolver extends JavaParserVisitorAdapter {
|
||||
@Override
|
||||
public Object visit(ASTPrimaryPrefix node, Object data) {
|
||||
super.visit(node, data);
|
||||
if (node.getImage() == null) {
|
||||
|
||||
if(node.jjtGetFirstToken().toString().equals("this")) {
|
||||
ASTClassOrInterfaceDeclaration typeDeclaration
|
||||
= node.getFirstParentOfType(ASTClassOrInterfaceDeclaration.class);
|
||||
if(typeDeclaration != null)
|
||||
node.setType(typeDeclaration.getType());
|
||||
} else if (node.getImage() == null) {
|
||||
rollupTypeUnary(node);
|
||||
} else {
|
||||
// TODO OMG, this is complicated. PrimaryExpression, PrimaryPrefix
|
||||
|
||||
Reference in new issue
Block a user