I'm facing a problem when trying to solve a method call expression which reference a declaration in a enum statement. Following, I leave a detail of my code.
public enum EscapeMode {
... some code ...
EscapeMode(String file, int size) {
load(this, file, size);
}
... some code ...
}
My VoidVisitorAdapter class I've implemented to look for MCEs.
public class MethodCallResolver extends VoidVisitorAdapter<Object>{
public void visit(MethodCallExpr mce, Object arg) {
super.visit(mce, arg);
try {
JavaParserFacade jpf = JavaParserFacade.get((CombinedTypeSolver) arg);
SymbolReference<ResolvedMethodDeclaration> reference = jpf.solve(mce);
if (reference.isSolved()) {
ResolvedMethodDeclaration md = reference.getCorrespondingDeclaration();
System.out.println("\t Solved : " + md.getQualifiedSignature());
solved++;
}else {
System.out.println("\t Not solved. Method Call: " + mce + ", line: " + mce.getBegin().get().line);
unsolved++;
}
}catch(UnsolvedSymbolException e) {
System.err.println("\t Error. Method Call: " + mce + ", line: " + mce.getBegin().get().line + ", " + e.getMessage());
errors++;
}
}
Next, is the line printed for unsolved references. In this case the unsolved reference is relative to the method declaration presented at the beginning.
Not solved. Method Call: Entities.EscapeMode.valueOf(escapeMode.name()), line: 542
Also I've noticed that all of my unsolved references are relative to enum method declaration.
Do you have any ideas of how to solve such MCE references?