if (line == null || line.trim().length() == 0)
return ret;
String cl = String.format(classTempForArgs, line);
try {
CompilationUnit cu = parse(cl);
VoidVisitorAdapter visitor = new VoidVisitorAdapter() {
@Override
public void visit(MethodCallExpr n, Object arg) {
List<Expression> args = n.getArgs();
// api issue: args can be null in case of empty arg list
if (args != null)
for (Expression e : args) {
ret.add(e.toString());
}
}
};
cu.accept(visitor, null);
} catch (ParseException e) {
throw new RuntimeException("the line does not seem to be a valid arg list: " + line);
}
return ret;
}