getLineText(i,lineSegment);
for(int j = 0; j < lineSegment.count; j++)
{
switch(lineSegment.array[lineSegment.offset + j])
{
case ' ':
case '\t':
break;
default:
continue loop;
}
}
start = getLineEndOffset(i);
getLineText(i,lineSegment);
for(int j = 0; j < lineSegment.count; j++)
{
switch(lineSegment.array[lineSegment.offset + j])
{
case ' ':
case '\t':
break;
default:
continue loop;
}
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/JEditTextArea.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/JEditTextArea.java
|
Method name: void formatParagraph()
|
|
Method name: void formatParagraph()
|
Number of AST nodes: 9
|
|
Number of AST nodes: 8
|
|
1 | getLineText(i,lineSegment);↵ | | 1 | getLineText(i,lineSegment);↵
|
|
2 | for(int j = 0; j < lineSegment.count; j++)↵ | | 2 | for(int j = 0; j < lineSegment.count; j++)↵
|
3 | {↵ | | 3 | {↵
|
4 | switch(lineSegment.array[lineSegment.offset + j])↵ | | 4 | switch(lineSegment.array[lineSegment.offset + j])↵
|
5 | {↵ | | 5 | {↵
|
6 | case ' ':↵ | | 6 | case ' ':↵
|
7 | case '\t':↵ | | 7 | case '\t':↵
|
8 | break;↵ | | 8 | break;↵
|
9 | default:↵ | | 9 | default:↵
|
10 | continue loop;↵ | | 10 | continue loop;↵
|
11 | }↵ | | 11 | }↵
|
12 | }↵ | | 12 | }
|
|
13 | start = getLineEndOffset(i); | | | |
See real code fragment |
|
See real code fragment |
Summary
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.6 |
Clones location | Clones are in the same method |
Number of node comparisons | 24 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.3 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
17 | getLineText(i, lineSegment); | | 28 | getLineText(i, lineSegment); |
18 | for (int j = 0; j < lineSegment.count; j++) | | 29 | for (int j = 0; j < lineSegment.count; j++) |
19 | switch (lineSegment.array[lineSegment.offset + j]) | | 30 | switch (lineSegment.array[lineSegment.offset + j]) |
20 | | | 31 | |
21 | | | 32 | |
22 | | | 33 | |
23 | | | 34 | |
24 | | | 35 | |
25 | start = getLineEndOffset(i); | | | |
Precondition Violations (3)
Row |
Violation |
1 | Statement continue loop; without innermost loop |
2 | Statement continue loop; without innermost loop |
3 | Unmatched statement start=getLineEndOffset(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |