if (args != null) { //isEmpty means empty-args method
final List<VarSymbol> formalArgs;
List<TypeSymbol> formalTypeParams;
final boolean varArgs;
if (e.getKind().equals(ElementKind.METHOD) || e.getKind().equals(ElementKind.CONSTRUCTOR)) {
MethodSymbol me = (MethodSymbol) e;
formalArgs = me.getParameters();
formalTypeParams = me.getTypeParameters();
if (formalTypeParams.isEmpty()) {
formalTypeParams = me.owner.getTypeParameters();
}
final boolean formalButActual = !formalTypeParams.isEmpty() && (typeParams == null || typeParams.isEmpty()); //basic type inference, shouldn't also check same args-size? Yes, but varargs!
if (formalButActual) {
formalTypeParams = null;//me.owner.getTypeParameters();
typeParams = null;
}
varArgs = me.isVarArgs();
} else {
formalArgs = null;
formalTypeParams = null;
varArgs = false;
}