String result = search(ctx,targetClass,memberDesc);
return result;
}
public String search(CompilerContext ctx , String targetClass, String memberDesc) {
MemberReferenceFinder app = new MemberReferenceFinder();
try {
app.findCallingMethodInDir(ctx.getOutputDir(), targetClass,memberDesc);
} catch (Exception e) {
e.printStackTrace();
}
StringBuilder sb = new StringBuilder();
for (ReferenceLocation loc : app.getReferenceLocations() ) {
sb.append(getSourcePath(ctx,loc.className,loc.source)).append(SEPERATOR);
sb.append(loc.line).append(SEPERATOR);
sb.append(getSourceLine(ctx,loc.className,loc.source,loc.line)).append("\n");
}
return sb.toString();