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; }
if (this == obj) { return true; } if (!(obj instanceof PlotRenderingInfo)) { return false; } PlotRenderingInfo that = (PlotRenderingInfo) obj; if (!ObjectUtilities.equal(this.dataArea, that.dataArea)) { return false; } if (!ObjectUtilities.equal(this.plotArea, that.plotArea)) { return false; } if (!ObjectUtilities.equal(this.subplotInfo, that.subplotInfo)) { 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/chart/plot/PlotRenderingInfo.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 11 Number of AST nodes: 12
1
if (obj instanceof Tick) {
1
if (
2
            Tick t = (Tick) obj
2
this == obj) {
3
;   
3
            return true;   
4
    
4
        }
5
        if (!ObjectUtilities.equal(this.text, t.text)) {
5
        if (!(obj instanceof PlotRenderingInfo)) {
6
                return false;   
6
            return false;
7
    
8
        }
7
        }
9
    
8
        PlotRenderingInfo that = (PlotRenderingInfo) obj;
10
        if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) {
9
        if (!ObjectUtilities.equal(this.dataArea, that.dataArea)) {
11
                return false;   
10
            return false;   
12
            }
11
        }
13
            if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor)) {
12
        if (!ObjectUtilities.equal(this.plotArea, that.plotArea)) {
14
                return false;   
13
            return false;   
15
            }
14
        }
16
            if (!(this.angle == t.angle)) {
15
        if (!ObjectUtilities.equal(this.subplotInfo, that.subplotInfo)) {
17
                return false;   
16
            return false;   
18
            }
17
        }
19
            return true;
18
        return true;
20
        }
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)2.4
Clones locationClones are in different classes
Number of node comparisons51
  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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    Tick t = (Tick)obj;
                                            
                                                                                                      
    5
    PlotRenderingInfo that = (PlotRenderingInfo)obj;
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    6
    if (!ObjectUtilities.equal(this.dataArea, that.dataArea))
    Differences
    Expression1Expression2Difference
    textdataAreaVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.awt.geom.Rectangle2DVARIABLE_TYPE_MISMATCH
    tthatVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Tickorg.jfree.chart.plot.PlotRenderingInfoVARIABLE_TYPE_MISMATCH
    textdataAreaVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.awt.geom.Rectangle2DVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable this.text does not match with type java.awt.geom.Rectangle2D of variable this.dataArea
    • Make classes java.lang.String and java.awt.geom.Rectangle2D extend a common superclass
    Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.dataArea 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.awt.geom.Rectangle2D of variable that.dataArea
    • Make classes org.jfree.chart.axis.Tick and org.jfree.chart.plot.PlotRenderingInfo extend a common superclass
    Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.dataArea 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.awt.geom.Rectangle2D of variable that.dataArea
    • Make classes java.lang.String and java.awt.geom.Rectangle2D extend a common superclass
    6
    if (!ObjectUtilities.equal(this.dataArea, that.dataArea))
    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.plotArea, that.plotArea))
    Differences
    Expression1Expression2Difference
    textAnchorplotAreaVARIABLE_NAME_MISMATCH
    org.jfree.ui.TextAnchorjava.awt.geom.Rectangle2DVARIABLE_TYPE_MISMATCH
    tthatVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Tickorg.jfree.chart.plot.PlotRenderingInfoVARIABLE_TYPE_MISMATCH
    textAnchorplotAreaVARIABLE_NAME_MISMATCH
    org.jfree.ui.TextAnchorjava.awt.geom.Rectangle2DVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.TextAnchor of variable this.textAnchor does not match with type java.awt.geom.Rectangle2D of variable this.plotArea
    • Make classes org.jfree.ui.TextAnchor and java.awt.geom.Rectangle2D extend a common superclass
    Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.plotArea 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 java.awt.geom.Rectangle2D of variable that.plotArea
    • Make classes org.jfree.chart.axis.Tick and org.jfree.chart.plot.PlotRenderingInfo extend a common superclass
    Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.plotArea 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 java.awt.geom.Rectangle2D of variable that.plotArea
    • Make classes org.jfree.ui.TextAnchor and java.awt.geom.Rectangle2D extend a common superclass
    8
    if (!ObjectUtilities.equal(this.plotArea, that.plotArea))
    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.subplotInfo, that.subplotInfo))
    Differences
    Expression1Expression2Difference
    rotationAnchorsubplotInfoVARIABLE_NAME_MISMATCH
    org.jfree.ui.TextAnchorjava.util.ListVARIABLE_TYPE_MISMATCH
    tthatVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Tickorg.jfree.chart.plot.PlotRenderingInfoVARIABLE_TYPE_MISMATCH
    rotationAnchorsubplotInfoVARIABLE_NAME_MISMATCH
    org.jfree.ui.TextAnchorjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.TextAnchor of variable this.rotationAnchor does not match with type java.util.List of variable this.subplotInfo
    • Make classes org.jfree.ui.TextAnchor and java.util.List extend a common superclass
    Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.subplotInfo 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.util.List of variable that.subplotInfo
    • Make classes org.jfree.chart.axis.Tick and org.jfree.chart.plot.PlotRenderingInfo extend a common superclass
    Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.subplotInfo 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.util.List of variable that.subplotInfo
    • Make classes org.jfree.ui.TextAnchor and java.util.List extend a common superclass
    10
    if (!ObjectUtilities.equal(this.subplotInfo, that.subplotInfo))
    10
    return false;
    11
    return false;
    11
    if (!(this.angle == t.angle))
    11
    if (!(this.angle == t.angle))
    3
    if (!(obj instanceof PlotRenderingInfo))
    Differences
    Expression1Expression2Difference
    this.angle == t.angleobj instanceof PlotRenderingInfoTYPE_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 (!(obj instanceof PlotRenderingInfo))
    12
    return false;
    4
    return false;
    Precondition Violations (23)
    Row Violation
    1Type java.lang.String of variable this.text does not match with type java.awt.geom.Rectangle2D of variable this.dataArea
    2Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.dataArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type java.lang.String of variable t.text does not match with type java.awt.geom.Rectangle2D of variable that.dataArea
    5Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.dataArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Type java.lang.String of variable t.text does not match with type java.awt.geom.Rectangle2D of variable that.dataArea
    8Type org.jfree.ui.TextAnchor of variable this.textAnchor does not match with type java.awt.geom.Rectangle2D of variable this.plotArea
    9Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.plotArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Type org.jfree.ui.TextAnchor of variable t.textAnchor does not match with type java.awt.geom.Rectangle2D of variable that.plotArea
    12Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression that.plotArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Type org.jfree.ui.TextAnchor of variable t.textAnchor does not match with type java.awt.geom.Rectangle2D of variable that.plotArea
    15Type org.jfree.ui.TextAnchor of variable this.rotationAnchor does not match with type java.util.List of variable this.subplotInfo
    16Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression that.subplotInfo cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Type org.jfree.ui.TextAnchor of variable t.rotationAnchor does not match with type java.util.List of variable that.subplotInfo
    19Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression that.subplotInfo cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Type org.jfree.ui.TextAnchor of variable t.rotationAnchor does not match with type java.util.List of variable that.subplotInfo
    22Expression this.angle == t.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Not all possible execution flows end in a return statement