case INTERFACE:
gen.add(new TypeRef(cu,srcPos,id,(TypeElement)e));
break;
case FIELD: // such as objects imported by static import.
case ENUM_CONSTANT:
gen.add(new FieldRef(cu,srcPos,id,(VariableElement)e));
break;
case PARAMETER:
case EXCEPTION_PARAMETER:
case LOCAL_VARIABLE:
gen.add(new LocalVarRef(cu,srcPos,id,(VariableElement)e));
break;
}
}
}
return super.visitIdentifier(id,_);
}
/**
* "exp.token"
*/
public Void visitMemberSelect(MemberSelectTree mst, Void _) {
// avoid marking 'Foo.class' as static reference
if(!mst.getIdentifier().equals(CLASS)) {
// just select the 'token' portion
long ep = srcPos.getEndPosition(cu,mst);
long sp = ep-mst.getIdentifier().length();
// marker for the selected identifier
Element e = TreeUtil.getElement(mst);
if(e!=null) {
switch(e.getKind()) {
case FIELD:
case ENUM_CONSTANT:
gen.add(new FieldRef(sp, ep, PositionUtils.getLineNumber(lineMap, sp), PositionUtils.getColNumber(lineMap, sp), (VariableElement)e));
break;
// these show up in the import statement
case ANNOTATION_TYPE:
case CLASS: