Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-dev] ConstructorInvocation visit

I'm trying to visit a compilation unit to find a certain Constructor
Invocation in that CU.
This is my parser setup

ASTParser parser = ASTParser.newParser(AST.JLS11);
parser.setSource(context.getCompilationUnit());
parser.setProject(context.getProject());
parser.setResolveBindings(true);
parser.setStatementsRecovery(true);
parser.setBindingsRecovery(true);
ASTNode ast = parser.createAST(monitor);
CompletionASTVistor visitor = new CompletionASTVistor(context);
ast.accept(visitor);

But my visit(ConstructorInvocation node) is never called.

My example code is as bellow

public class Foo {
  public static void main(String[] args) {
    Bar bar = new Bar(Arrays.asList("Hello"));
  }

  public static class Bar {
    public Bar(List<String> args) {}
  }
}

Any reason why the ConstructorInvocation for Bar(...) is not invoked ?

Thanks,
Gayan.


Back to the top