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;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)6.9
Clones locationClones are in different classes
Number of node comparisons42
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (obj == this)
    1
    if (obj == this)
    1
    if (object == this)
    Differences
    Expression1Expression2Difference
    objobjectVARIABLE_NAME_MISMATCH
    1
    if (object == this)
    2
    return true;
    2
    return true;
    3
    if (!(obj instanceof DefaultIntervalCategoryDataset))
    3
    if (!(obj instanceof DefaultIntervalCategoryDataset))
    3
    if (!(object instanceof Task))
    Differences
    Expression1Expression2Difference
    objobjectVARIABLE_NAME_MISMATCH
    org.jfree.data.category.DefaultIntervalCategoryDatasetorg.jfree.data.gantt.TaskVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.data.category.DefaultIntervalCategoryDataset does not match with type org.jfree.data.gantt.Task
    • Make classes org.jfree.data.category.DefaultIntervalCategoryDataset and org.jfree.data.gantt.Task extend a common superclass
    3
    if (!(object instanceof Task))
    4
    return false;
    4
    return false;
    Precondition Violations (3)
    Row Violation
    1Type org.jfree.data.category.DefaultIntervalCategoryDataset does not match with type org.jfree.data.gantt.Task
    2Not all possible execution flows end in a return statement
    3The 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