File path: /emf-2.4.1/src/org/eclipse/emf/mapping/domain/AdapterFactoryMappingDomain.java | File path: /emf-2.4.1/src/org/eclipse/emf/mapping/domain/AdapterFactoryMappingDomain.java | |||
Method name: String convertSeparator(String, char, char, int)
|
Method name: String change(String, String, String)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | newIndex = sourceName.indexOf(sourceSeparator, lastIndex);↵ | 1 | newIndex = in.indexOf(oldPat, lastIndex);↵ | |
2 | if (newIndex != -1) ↵ | 2 | if (newIndex != -1)↵ | |
3 | ↵ | |||
4 | {↵ | 3 | {↵ | |
5 | newString.append(sourceName.substring(lastIndex, newIndex));↵ | 4 | newString.append(in.substring(lastIndex, newIndex) + newPat);↵ | |
6 | lastIndex = newIndex + 1;↵ | 5 | lastIndex = newIndex + oldPat.length();↵ | |
7 | }↵ | 6 | }↵ | |
8 | else ↵ | 7 | else↵ | |
9 | ↵ | |||
10 | {↵ | 8 | {↵ | |
11 | newString.append(sourceName.substring(lastIndex));↵ | 9 | newString.append(in.substring(lastIndex));↵ | |
12 | break;↵ | 10 | break;↵ | |
13 | } | 11 |
| |
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 27 |
Number of mapped statements | 6 |
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.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10 | newIndex = sourceName.indexOf(sourceSeparator, lastIndex); |
| 9 | newIndex = in.indexOf(oldPat, lastIndex); | |||||||||||||||||
11 | if (newIndex != -1) | 10 | if (newIndex != -1) | ||||||||||||||||||
12 | newString.append(sourceName.substring(lastIndex, newIndex)); |
| 11 | newString.append(in.substring(lastIndex, newIndex) + newPat); | |||||||||||||||||
13 | lastIndex = newIndex + 1; |
| 12 | lastIndex = newIndex + oldPat.length(); | |||||||||||||||||
else | else | ||||||||||||||||||||
14 | newString.append(sourceName.substring(lastIndex)); |
| 13 | newString.append(in.substring(lastIndex)); | |||||||||||||||||
15 | break; |
| 14 | break; |
Row | Violation |
---|---|
1 | Type char of variable sourceSeparator does not match with type java.lang.String of variable oldPat |
2 | Expression sourceName.substring(lastIndex,newIndex) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression in.substring(lastIndex,newIndex) + newPat cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Statement break; without innermost loop |
5 | Statement break; without innermost loop |