if (obj == this) {
return true;
}
if (!(obj instanceof DefaultIntervalCategoryDataset)) {
return false;
}
DefaultIntervalCategoryDataset that
= (DefaultIntervalCategoryDataset) obj;
if (!Arrays.equals(this.seriesKeys, that.seriesKeys)) {
return false;
}
if (!Arrays.equals(this.categoryKeys, that.categoryKeys)) {
return false;
}
if (!equal(this.startData, that.startData)) {
return false;
}
if (!equal(this.endData, that.endData)) {
return false;
}
// seem to be the same...
return true;
if (object == this) {
return true;
}
if (!(object instanceof Task)) {
return false;
}
Task that = (Task) object;
if (!ObjectUtilities.equal(this.description, that.description)) {
return false;
}
if (!ObjectUtilities.equal(this.duration, that.duration)) {
return false;
}
if (!ObjectUtilities.equal(this.percentComplete,
that.percentComplete)) {
return false;
}
if (!ObjectUtilities.equal(this.subtasks, that.subtasks)) {
return false;
}
return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/category/DefaultIntervalCategoryDataset.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/data/gantt/Task.java
|
Method name: boolean equals(Object)
|
|
Method name: boolean equals(Object)
|
Number of AST nodes: 14
|
|
Number of AST nodes: 14
|
|
1 | if (obj == this) {↵ | | 1 | if (object == this) {↵
|
2 | return true;↵ | | 2 | return true;↵
|
3 | }↵ | | 3 | }↵
|
4 | if (!(obj instanceof DefaultIntervalCategoryDataset)) {↵ | | 4 | if (!(object instanceof Task)) {↵
|
5 | return false;↵ | | 5 | return false;↵
|
6 | }↵ | | 6 | }↵
|
7 | DefaultIntervalCategoryDataset that ↵ | | 7 | ↵
|
8 | = (DefaultIntervalCategoryDataset) obj;↵ | | 8 | Task that = (Task) object;↵
|
9 | if (!Arrays.equals(this.seriesKeys, that.seriesKeys)) {↵ | | 9 | if (!ObjectUtilities.equal(this.description, that.description)) {↵
|
10 | return false;↵ | | 10 | return false;↵
|
11 | }↵ | | 11 | }↵
|
12 | if (!Arrays.equals(this.categoryKeys, that.categoryKeys)) {↵ | | 12 | if (!ObjectUtilities.equal(this.duration, that.duration)) {↵
|
13 | return false;↵ | | 13 | return false;↵
|
14 | }↵ | | 14 | }↵
|
15 | if (!equal(this.startData, that.startData↵ | | 15 | if (!ObjectUtilities.equal(this.percentComplete, ↵
|
16 | )) {↵ | | 16 | that.percentComplete)) {↵
|
17 | return false;↵ | | 17 | return false;↵
|
18 | }↵ | | 18 | }↵
|
19 | if (!equal(this.endData, that.endData)) {↵ | | 19 | if (!ObjectUtilities.equal(this.subtasks, that.subtasks)) {↵
|
20 | return false;↵ | | 20 | return false;↵
|
21 | }↵ | | 21 | }↵
|
22 | // seem to be the same...↵ | | |
|
23 | return true; | | 22 | return 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) | 6.9 |
Clones location | Clones are in different classes |
Number of node comparisons | 42 |
-
{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) | 1.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (obj == this) | | 1 | if (object == this) |
2 | | | 2 | |
3 | if (!(obj instanceof DefaultIntervalCategoryDataset)) | | 3 | if (!(object instanceof Task)) |
4 | | | 4 | |
Precondition Violations (3)
Row |
Violation |
1 | Type org.jfree.data.category.DefaultIntervalCategoryDataset does not match with type org.jfree.data.gantt.Task |
2 | Not all possible execution flows end in a return statement |
3 | The refactoring of the clones is infeasible, because classes org.jfree.data.category.DefaultIntervalCategoryDataset and org.jfree.data.gantt.Task do not have a common superclass |