Consider code like:
---
class Constructors extends BaseWithConstructor {
Constructors(String name) {
System.err.println();
this(name.length());
super(name.length());
this(name.length());
}
Constructors(int i) {super(i);}
}
class BaseWithConstructor {
BaseWithConstructor(int len) {}
}
---
Attr.visitApply will not attribute the this/super constructor invocations inside Constructors(String name), as it only attributes the first this/super constructor invocation (if any). As a result Trees.getElement (or Trees.getTypeMirror) will not return good results on AST node from inside these this/super constructor invocations.
---
class Constructors extends BaseWithConstructor {
Constructors(String name) {
System.err.println();
this(name.length());
super(name.length());
this(name.length());
}
Constructors(int i) {super(i);}
}
class BaseWithConstructor {
BaseWithConstructor(int len) {}
}
---
Attr.visitApply will not attribute the this/super constructor invocations inside Constructors(String name), as it only attributes the first this/super constructor invocation (if any). As a result Trees.getElement (or Trees.getTypeMirror) will not return good results on AST node from inside these this/super constructor invocations.