File path: /emf-2.4.1/src/org/eclipse/emf/common/EMFPlugin.java | File path: /emf-2.4.1/src/org/eclipse/emf/common/util/DelegatingResourceLocator.java | |||
Method name: void main(String[])
|
Method name: URL getBaseURL()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | String className = theClass.getName();↵ | 1 | String className = theClass.getName();↵ | |
2 | int index = className.lastIndexOf(".");↵ | 2 | int index = className.lastIndexOf(".");↵ | |
3 | URL classURL = theClass.getResource((index == -1 ? className : className.substring(index + 1)) + ".class");↵ | 3 | URL classURL = theClass.getResource((index == -1 ? className : className.substring(index + 1)) + ".class");↵ | |
4 | URI uri = URI.createURI(classURL.toString());↵ | 4 | URI uri = URI.createURI(classURL.toString());↵ | |
5 | // Trim off the segments corresponding to the package nesting.↵ | 5 | // Trim off the segments corresponding to the package nesting.↵ | |
6 | //↵ | 6 | ↵ | |
7 | //↵ | |||
7 | int count = 1;↵ | 8 | int count = 1;↵ | |
8 | for (int i = 0; (i = className.indexOf('.', i)) != -1; ++i)↵ | 9 | for (int i = 0; (i = className.indexOf('.', i)) != -1; ++i)↵ | |
9 | {↵ | 10 | ↵ | |
11 | {↵ | |||
10 | ++count;↵ | 12 | ++count;↵ | |
11 | }↵ | 13 | ↵ | |
14 | }↵ | |||
12 | uri = uri.trimSegments(count); | 15 | uri = uri.trimSegments(count); | |
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 | 41 |
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | String className = theClass.getName(); |
| 7 | String className = theClass.getName(); | |||||||||||
5 | int index = className.lastIndexOf("."); | 8 | int index = className.lastIndexOf("."); | ||||||||||||
6 | URL classURL = theClass.getResource((index == -1 ? className : className.substring(index + 1)) + ".class"); |
| 9 | URL classURL = theClass.getResource((index == -1 ? className : className.substring(index + 1)) + ".class"); | |||||||||||
7 | URI uri = URI.createURI(classURL.toString()); | 10 | URI uri = URI.createURI(classURL.toString()); | ||||||||||||
8 | int count = 1; | 11 | int count = 1; | ||||||||||||
9 | for (int i = 0; (i = className.indexOf('.', i)) != -1; ++i) | 12 | for (int i = 0; (i = className.indexOf('.', i)) != -1; ++i) | ||||||||||||
10 | ++count; | 13 | ++count; | ||||||||||||
11 | uri = uri.trimSegments(count); | 14 | uri = uri.trimSegments(count); |
Row | Violation |
---|---|
1 | Type java.lang.Class<> of variable theClass does not match with type java.lang.Class<> of variable theClass |
2 | Type java.lang.Class<> of variable theClass does not match with type java.lang.Class<> of variable theClass |
3 | Clone fragment #1 returns variables uri , while Clone fragment #2 returns variables uri, className, index |