File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ANTLR.java | |||
Method name: boolean addClasspathEntry(String)
|
Method name: void addClasspathEntry(String)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 8 | |||
1 | if (resource.startsWith("/")) {↵ | 1 | if (resource.startsWith("/")) {↵ | |
2 | resource = resource.substring(1);↵ | 2 | resource = resource.substring(1);↵ | |
3 | } else {↵ | 3 | } else {↵ | |
4 | resource = "org/apache/tools/ant/taskdefs/optional/junit/"↵ | 4 | resource = "org/apache/tools/ant/taskdefs/optional/"↵ | |
5 | + resource;↵ | 5 | + resource;↵ | |
6 | }↵ | 6 | }↵ | |
7 | File f = LoaderUtils.getResourceSource(getClass().getClassLoader(),↵ | 7 | File f = LoaderUtils.getResourceSource(getClass().getClassLoader(),↵ | |
8 | resource);↵ | 8 | resource);↵ | |
9 | if (f != null) {↵ | 9 | if (f != null) {↵ | |
10 | log("Found " + f.getAbsolutePath(), Project.MSG_DEBUG);↵ | 10 | log("Found " + f.getAbsolutePath(), Project.MSG_DEBUG);↵ | |
11 | antRuntimeClasses.createPath().setLocation(f);↵ | 11 | createClasspath().setLocation(f);↵ | |
12 | return true;↵ | |||
13 | } else {↵ | 12 | } else {↵ | |
14 | log("Couldn\'t find " + resource, Project.MSG_DEBUG);↵ | 13 | log("Couldn\'t find " + resource, Project.MSG_↵ | |
15 | return false;↵ | 14 | VERBOSE);↵ | |
16 | } | 15 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 47 |
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 5.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (resource.startsWith("/")) | 1 | if (resource.startsWith("/")) | ||||||||||||||
2 | resource = resource.substring(1); | 2 | resource = resource.substring(1); | ||||||||||||||
else | else | ||||||||||||||||
3 | resource = "org/apache/tools/ant/taskdefs/optional/junit/" + resource; |
| 3 | resource = "org/apache/tools/ant/taskdefs/optional/" + resource; | |||||||||||||
4 | File f = LoaderUtils.getResourceSource(getClass().getClassLoader(), resource); |
| 4 | File f = LoaderUtils.getResourceSource(getClass().getClassLoader(), resource); | |||||||||||||
5 | if (f != null) | 5 | if (f != null) | ||||||||||||||
6 | log("Found " + f.getAbsolutePath(), Project.MSG_DEBUG); | 6 | log("Found " + f.getAbsolutePath(), Project.MSG_DEBUG); | ||||||||||||||
7 | antRuntimeClasses.createPath().setLocation(f); |
| 7 | createClasspath().setLocation(f); | |||||||||||||
8 | return true; |
| | ||||||||||||||
else | else | ||||||||||||||||
9 | log("Couldn\'t find " + resource, Project.MSG_DEBUG); |
| 8 | log("Couldn\'t find " + resource, Project.MSG_VERBOSE); | |||||||||||||
10 | return false; |
| |
Row | Violation |
---|---|
1 | Type java.lang.Class<> of variable getClass() does not match with type java.lang.Class<> of variable getClass() |
2 | Unmatched return true; |
3 | Unmatched return false; |