if (this == obj) { return true; } if (obj instanceof Tick) { Tick t = (Tick) obj; if (!ObjectUtilities.equal(this.text, t.text)) { return false; } if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) { return false; } if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor)) { return false; } if (!(this.angle == t.angle)) { return false; } return true; } return false;
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/chart/axis/Tick.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 (this == obj) {
1
if (object == this) {
2
            return true;   
2
            return true;
3
        }
3
        }
4
        if (obj instanceof Tick) {
4
        if (!(object instanceof Task)) {
5
            Tick 
5
            return false;
6
        }
6
t = (Tick) obj;   
7
        Task that = (Task) obj
7
    
8
ect;
8
        if (!ObjectUtilities.equal(this.text, t.text)) {
9
        if (!ObjectUtilities.equal(this.description, that.description)) {
9
                return false;   
10
            return false;
10
            }
11
        }
11
            if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) {
12
        if (!ObjectUtilities.equal(this.duration, that.duration)) {
12
                return false;   
13
            return false;
13
    
14
        }
14
        }
15
            if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor
15
        if (!ObjectUtilities.equal(this.percentComplete, 
16
)) {
16
                that.percentComplete)) {
17
                return false;   
17
            return false;
18
    
19
        }
18
        }
20
            if (!(this.angle == t.angle)) {
19
        if (!ObjectUtilities.equal(this.subtasks, that.subtasks)) {
21
                return false;   
20
            return false;
22
    
23
        }
21
        }
24
            return true;
22
        return true;
25
        }
26
        return false;
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)3.1
Clones locationClones are in different classes
Number of node comparisons55
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    Tick t = (Tick)obj;
                                            
                                                        
    5
    Task that = (Task)object;
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    6
    if (!ObjectUtilities.equal(this.description, that.description))
    Differences
    Expression1Expression2Difference
    textdescriptionVARIABLE_NAME_MISMATCH
    tthatVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Tickorg.jfree.data.gantt.TaskVARIABLE_TYPE_MISMATCH
    textdescriptionVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.description cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable t.text does not match with type java.lang.String of variable that.description
    • Make classes org.jfree.chart.axis.Tick and org.jfree.data.gantt.Task extend a common superclass
    Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.description cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (!ObjectUtilities.equal(this.description, that.description))
    6
    return false;
    7
    return false;
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    8
    if (!ObjectUtilities.equal(this.duration, that.duration))
    Differences
    Expression1Expression2Difference
    textAnchordurationVARIABLE_NAME_MISMATCH
    org.jfree.ui.TextAnchororg.jfree.data.time.TimePeriodVARIABLE_TYPE_MISMATCH
    tthatVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Tickorg.jfree.data.gantt.TaskVARIABLE_TYPE_MISMATCH
    textAnchordurationVARIABLE_NAME_MISMATCH
    org.jfree.ui.TextAnchororg.jfree.data.time.TimePeriodVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.TextAnchor of variable this.textAnchor does not match with type org.jfree.data.time.TimePeriod of variable this.duration
    • Make classes org.jfree.ui.TextAnchor and org.jfree.data.time.TimePeriod extend a common superclass
    Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.duration cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.ui.TextAnchor of variable t.textAnchor does not match with type org.jfree.data.time.TimePeriod of variable that.duration
    • Make classes org.jfree.chart.axis.Tick and org.jfree.data.gantt.Task extend a common superclass
    Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.duration cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.ui.TextAnchor of variable t.textAnchor does not match with type org.jfree.data.time.TimePeriod of variable that.duration
    • Make classes org.jfree.ui.TextAnchor and org.jfree.data.time.TimePeriod extend a common superclass
    8
    if (!ObjectUtilities.equal(this.duration, that.duration))
    8
    return false;
    9
    return false;
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    10
    if (!ObjectUtilities.equal(this.percentComplete, that.percentComplete))
    Differences
    Expression1Expression2Difference
    rotationAnchorpercentCompleteVARIABLE_NAME_MISMATCH
    org.jfree.ui.TextAnchorjava.lang.DoubleVARIABLE_TYPE_MISMATCH
    tthatVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Tickorg.jfree.data.gantt.TaskVARIABLE_TYPE_MISMATCH
    rotationAnchorpercentCompleteVARIABLE_NAME_MISMATCH
    org.jfree.ui.TextAnchorjava.lang.DoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.TextAnchor of variable this.rotationAnchor does not match with type java.lang.Double of variable this.percentComplete
    • Make classes org.jfree.ui.TextAnchor and java.lang.Double extend a common superclass
    Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.percentComplete cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.ui.TextAnchor of variable t.rotationAnchor does not match with type java.lang.Double of variable that.percentComplete
    • Make classes org.jfree.chart.axis.Tick and org.jfree.data.gantt.Task extend a common superclass
    Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.percentComplete cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.ui.TextAnchor of variable t.rotationAnchor does not match with type java.lang.Double of variable that.percentComplete
    • Make classes org.jfree.ui.TextAnchor and java.lang.Double extend a common superclass
    10
    if (!ObjectUtilities.equal(this.percentComplete, that.percentComplete))
    10
    return false;
    11
    return false;
    11
    if (!(this.angle == t.angle))
    11
    if (!(this.angle == t.angle))
    3
    if (!(object instanceof Task))
    Differences
    Expression1Expression2Difference
    this.angle == t.angleobject instanceof TaskTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.angle == t.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    if (!(object instanceof Task))
    12
    return false;
    4
    return false;
    Precondition Violations (21)
    Row Violation
    1Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression that.description cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type java.lang.String of variable t.text does not match with type java.lang.String of variable that.description
    4Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.description cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type org.jfree.ui.TextAnchor of variable this.textAnchor does not match with type org.jfree.data.time.TimePeriod of variable this.duration
    7Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.duration cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Type org.jfree.ui.TextAnchor of variable t.textAnchor does not match with type org.jfree.data.time.TimePeriod of variable that.duration
    10Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.duration cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type org.jfree.ui.TextAnchor of variable t.textAnchor does not match with type org.jfree.data.time.TimePeriod of variable that.duration
    13Type org.jfree.ui.TextAnchor of variable this.rotationAnchor does not match with type java.lang.Double of variable this.percentComplete
    14Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.percentComplete cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type org.jfree.ui.TextAnchor of variable t.rotationAnchor does not match with type java.lang.Double of variable that.percentComplete
    17Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression that.percentComplete cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Type org.jfree.ui.TextAnchor of variable t.rotationAnchor does not match with type java.lang.Double of variable that.percentComplete
    20Expression this.angle == t.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Not all possible execution flows end in a return statement