chunks = (Chunk)out.get(0);
out.remove(0);
offset = chunks.offset;
if(out.size() != 0)
length = ((Chunk)out.get(0)).offset - offset;
else
length = textArea.getLineLength(physicalLine) - offset + 1;
chunks = (Chunk)out.get(0);
out.remove(0);
offset = chunks.offset;
if(out.size() != 0)
length = ((Chunk)out.get(0)).offset - offset;
else
length = textArea.getLineLength(physicalLine) - offset + 1;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/ChunkCache.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/ChunkCache.java
|
Method name: void updateChunksUpTo(int)
|
|
Method name: void updateChunksUpTo(int)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | chunks = (Chunk)out.get(0);↵ | | 1 | chunks = (Chunk)out.get(0);↵
|
2 | out.remove(0);↵ | | 2 | out.remove(0);↵
|
3 | offset = chunks.offset;↵ | | 3 | offset = chunks.offset;↵
|
4 | if(out.size() != 0)↵ | | 4 | if(out.size() != 0)↵
|
5 | length = ((Chunk)out.get(0)).offset - offset;↵ | | 5 | length = ((Chunk)out.get(0)).offset - offset;↵
|
6 | else↵ | | 6 | else↵
|
7 | length = textArea.getLineLength(physicalLine) - offset + 1; | | 7 | length = textArea.getLineLength(physicalLine) - offset + 1;
|
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) | 2.5 |
Clones location | Clones are in the same method |
Number of node comparisons | 53 |
-
{Non-refactorable}
Mapping Summary
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) | 5.8 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
58 | chunks = (Chunk)out.get(0); | | 65 | chunks = (Chunk)out.get(0); |
59 | out.remove(0); | | 66 | out.remove(0); |
60 | offset = chunks.offset; | | 67 | offset = chunks.offset; |
61 | if (out.size() != 0) | | 68 | if (out.size() != 0) |
62 | length = ((Chunk)out.get(0)).offset - offset; | | 69 | length = ((Chunk)out.get(0)).offset - offset; |
| | | | |
63 | length = textArea.getLineLength(physicalLine) - offset + 1; | | 70 | length = textArea.getLineLength(physicalLine) - offset + 1; |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables offset, length, chunks , while Clone fragment #2 returns variables offset, length, chunks |