Skip to content

Commit d53d8ca

Browse files
committed
code review changes pt2, shorten input to pair using temp vars
1 parent 7754728 commit d53d8ca

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/gr/gousiosg/javacg/stat/JCallGraph.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,13 @@ public static ArrayList<Pair<String, String>> fetchAllMethodSignaturesForyaml (J
264264
JavaClass jc = cp.parse();
265265

266266
Method[] methods = jc.getMethods();
267+
String className =jc.getClassName().substring(jc.getClassName().lastIndexOf(".")+1);
267268
ArrayList<Pair<String, String>> signatureResults = new ArrayList<>();
268269
for(Method tempMethod : methods)
269-
if(Arrays.stream(tempMethod.getAnnotationEntries()).filter(e->e.getAnnotationType().equals("Lorg/junit/Test;")).toArray().length > 0)
270-
signatureResults.add(new Pair<>(jc.getClassName().substring(jc.getClassName().lastIndexOf(".")+1)+"#"+tempMethod.getName(),jc.getClassName() + "." + tempMethod.getName() + tempMethod.getSignature()));
271-
272-
270+
if(Arrays.stream(tempMethod.getAnnotationEntries()).filter(e->e.getAnnotationType().equals("Lorg/junit/Test;")).toArray().length > 0){
271+
String methodDescriptor=tempMethod.getName() + tempMethod.getSignature();
272+
signatureResults.add(new Pair<>(className+"#"+tempMethod.getName(),jc.getClassName() + "." + methodDescriptor));
273+
}
273274
return signatureResults;
274275
}
275276
//Fetch the method signature of a method from a JarEntry

0 commit comments

Comments
 (0)