currentLineWidth += newString.length();
LOOP: for (int i = newString.length() - 1; i >= 0; --i)
{
switch (newString.charAt(i))
{
case '\n':
case '\r':
{
currentLineWidth = newString.length() - i;
break LOOP;
}
}
}
currentLineWidth += newString.length();
LOOP: for (int i = newString.length() - 1; i >= 0; --i)
{
switch (newString.charAt(i))
{
case '\n':
case '\r':
{
currentLineWidth = newString.length() - i;
break LOOP;
}
}
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLString.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLString.java
|
Method name: void addCDATA(String)
|
|
Method name: void addComment(String)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | currentLineWidth += newString.length();↵ | | 1 | currentLineWidth += newString.length();↵
|
2 | LOOP: for (int i = newString.length() - 1; i >= 0; --i)↵ | | 2 | LOOP: for (int i = newString.length() - 1; i >= 0; --i)↵
|
3 | {↵ | | 3 | {↵
|
4 | switch (newString.charAt(i))↵ | | 4 | switch (newString.charAt(i))↵
|
5 | {↵ | | 5 | {↵
|
6 | case '\n':↵ | | 6 | case '\n':↵
|
7 | case '\r':↵ | | 7 | case '\r':↵
|
8 | {↵ | | 8 | {↵
|
9 | currentLineWidth = newString.length() - i;↵ | | 9 | currentLineWidth = newString.length() - i;↵
|
10 | break LOOP;↵ | | 10 | break LOOP;↵
|
11 | }↵ | | 11 | }↵
|
12 | }↵ | | 12 | }↵
|
13 | } | | 13 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 17 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
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.1 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | currentLineWidth += newString.length(); | | 7 | currentLineWidth += newString.length(); |
6 | for (int i = newString.length() - 1; i >= 0; --i) | | 8 | for (int i = newString.length() - 1; i >= 0; --i) |
7 | switch (newString.charAt(i)) | | 9 | switch (newString.charAt(i)) |
8 | | | 10 | |
9 | | | 11 | |
10 | currentLineWidth = newString.length() - i; | | 12 | currentLineWidth = newString.length() - i; |
11 | | | 13 | |
Precondition Violations (0)
Row |
Violation |