while (iterator.hasNext()) {
Task task = (Task) iterator.next();
String key = task.getDescription();
int index = this.keys.indexOf(key);
if (index < 0) {
this.keys.add(key);
}
}
while (iterator.hasNext()) {
Task task = (Task) iterator.next();
String key = task.getDescription();
int index = this.keys.indexOf(key);
if (index < 0) {
this.keys.add(key);
}
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/gantt/TaskSeriesCollection.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/data/gantt/TaskSeriesCollection.java
|
Method name: void add(TaskSeries)
|
|
Method name: void refreshKeys()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | while (iterator.hasNext()) {↵ | | 1 | while (iterator.hasNext()) {↵
|
2 | Task task = (Task) iterator.next();↵ | | 2 | Task task = (Task) iterator.next();↵
|
3 | String key = task.getDescription();↵ | | 3 | String key = task.getDescription();↵
|
4 | int index = this.keys.indexOf(key);↵ | | 4 | int index = this.keys.indexOf(key);↵
|
5 | if (index < 0) {↵ | | 5 | if (index < 0) {↵
|
6 | this.keys.add(key);↵ | | 6 | this.keys.add(key);↵
|
7 | }↵ | | 7 | ↵
|
| | | 8 | }↵
|
8 | } | | 9 | }
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 21 |
-
{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) | 9.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | while (iterator.hasNext()) | | 5 | while (iterator.hasNext()) |
7 | Task task = (Task)iterator.next(); | | 6 | Task task = (Task)iterator.next(); |
8 | String key = task.getDescription(); | | 7 | String key = task.getDescription(); |
9 | int index = this.keys.indexOf(key); | | 8 | int index = this.keys.indexOf(key); |
10 | | | 9 | |
11 | | | 10 | |
Precondition Violations (0)
Row |
Violation |