if(positions.size() == 0)
return;
/* get all positions from offset to the end, inclusive */
Iterator iter = positions.tailMap(new PosBottomHalf(offset))
.keySet().iterator();
iteration = true;
if(positions.size() == 0)
return;
/* get all positions from offset to the end, inclusive */
Iterator iter = positions.tailMap(new PosBottomHalf(offset))
.keySet().iterator();
iteration = true;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/buffer/PositionManager.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/buffer/PositionManager.java
|
Method name: void contentInserted(int, int)
|
|
Method name: void contentRemoved(int, int)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if(positions.size() == 0)↵ | | 1 | if(positions.size() == 0)↵
|
2 | return;↵ | | 2 | return;↵
|
|
3 | /* get all positions from offset to the end, inclusive */↵ | | 3 | /* get all positions from offset to the end, inclusive */↵
|
4 | Iterator iter = positions.tailMap(new PosBottomHalf(offset))↵ | | 4 | Iterator iter = positions.tailMap(new PosBottomHalf(offset))↵
|
5 | .keySet().iterator();↵ | | 5 | .keySet().iterator();↵
|
|
6 | iteration = true; | | 6 | iteration = true;
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 7 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 0.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (positions.size() == 0) | | 1 | if (positions.size() == 0) |
2 | | | 2 | |
3 | Iterator iter = positions.tailMap(new PosBottomHalf(offset)).keySet().iterator(); | | 3 | Iterator iter = positions.tailMap(new PosBottomHalf(offset)).keySet().iterator(); |
4 | iteration = true; | | 4 | iteration = true; |
Precondition Violations (2)
Row |
Violation |
1 | Conditional return; |
2 | Conditional return; |