if (this == obj) { return true; } if (obj instanceof CategoryTick && super.equals(obj)) { CategoryTick that = (CategoryTick) obj; if (!ObjectUtilities.equal(this.category, that.category)) { return false; } if (!ObjectUtilities.equal(this.label, that.label)) { return false; } if (!ObjectUtilities.equal(this.labelAnchor, that.labelAnchor)) { return false; } return true; } return false;
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/CategoryTick.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: 12 Number of AST nodes: 12
1
if (this == obj) {
1
if (this == obj) {
2
            return true;   
2
            return true;   
3
        }
3
        }
4
        if (obj instanceof CategoryTick && super.equals(obj)) {
4
        if (!(obj instanceof 
5
            CategoryTick that = (CategoryTick) obj;   
6
    
5
PlotRenderingInfo)) {
6
            return false;
7
        }
8
        PlotRenderingInfo that = (PlotRenderingInfo) obj;
7
        if (!ObjectUtilities.equal(this.category, that.category)) {
9
        if (!ObjectUtilities.equal(this.dataArea, that.dataArea)) {
8
                return false;   
10
            return false;   
9
            }
11
        
10
    
12
}
11
        if (!ObjectUtilities.equal(this.label, that.label)) {
13
        if (!ObjectUtilities.equal(this.plotArea, that.plotArea)) {
12
                return false;   
14
            return false;   
13
            }
15
        }
14
            if (!ObjectUtilities.equal(this.labelAnchor, that.labelAnchor)) {
16
        if (!ObjectUtilities.equal(this.subplotInfo, that.subplotInfo)) {
15
                return false;   
17
            return false;   
16
           }
18
        }
17
            return true;
19
        return true;
18
        }
19
        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)2.2
Clones locationClones are in different classes
Number of node comparisons34
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    CategoryTick that = (CategoryTick)obj;
                                                                                  
                                                                                                      
    5
    PlotRenderingInfo that = (PlotRenderingInfo)obj;
    5
    if (!ObjectUtilities.equal(this.category, that.category))
    5
    if (!ObjectUtilities.equal(this.category, that.category))
    6
    if (!ObjectUtilities.equal(this.dataArea, that.dataArea))
    Differences
    Expression1Expression2Difference
    categorydataAreaVARIABLE_NAME_MISMATCH
    java.lang.Comparablejava.awt.geom.Rectangle2DVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryTickorg.jfree.chart.plot.PlotRenderingInfoVARIABLE_TYPE_MISMATCH
    categorydataAreaVARIABLE_NAME_MISMATCH
    java.lang.Comparablejava.awt.geom.Rectangle2DVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Comparable of variable this.category does not match with type java.awt.geom.Rectangle2D of variable this.dataArea
    • Make classes java.lang.Comparable and java.awt.geom.Rectangle2D extend a common superclass
    Type java.lang.Comparable of variable that.category does not match with type java.awt.geom.Rectangle2D of variable that.dataArea
    • Make classes org.jfree.chart.axis.CategoryTick and org.jfree.chart.plot.PlotRenderingInfo extend a common superclass
    Expression that.category 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.Comparable of variable that.category does not match with type java.awt.geom.Rectangle2D of variable that.dataArea
    • Make classes java.lang.Comparable 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.label, that.label))
    7
    if (!ObjectUtilities.equal(this.label, that.label))
    8
    if (!ObjectUtilities.equal(this.plotArea, that.plotArea))
    Differences
    Expression1Expression2Difference
    labelplotAreaVARIABLE_NAME_MISMATCH
    org.jfree.text.TextBlockjava.awt.geom.Rectangle2DVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryTickorg.jfree.chart.plot.PlotRenderingInfoVARIABLE_TYPE_MISMATCH
    labelplotAreaVARIABLE_NAME_MISMATCH
    org.jfree.text.TextBlockjava.awt.geom.Rectangle2DVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.text.TextBlock of variable this.label does not match with type java.awt.geom.Rectangle2D of variable this.plotArea
    • Make classes org.jfree.text.TextBlock and java.awt.geom.Rectangle2D extend a common superclass
    Type org.jfree.text.TextBlock of variable that.label does not match with type java.awt.geom.Rectangle2D of variable that.plotArea
    • Make classes org.jfree.chart.axis.CategoryTick and org.jfree.chart.plot.PlotRenderingInfo extend a common superclass
    Expression that.label 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.text.TextBlock of variable that.label does not match with type java.awt.geom.Rectangle2D of variable that.plotArea
    • Make classes org.jfree.text.TextBlock 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.labelAnchor, that.labelAnchor))
    9
    if (!ObjectUtilities.equal(this.labelAnchor, that.labelAnchor))
    3
    if (!(obj instanceof PlotRenderingInfo))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.labelAnchor,that.labelAnchor)(obj instanceof PlotRenderingInfo)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.labelAnchor,that.labelAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    if (!(obj instanceof PlotRenderingInfo))
    10
    return false;
    4
    return false;
    Precondition Violations (12)
    Row Violation
    1Type java.lang.Comparable of variable this.category does not match with type java.awt.geom.Rectangle2D of variable this.dataArea
    2Type java.lang.Comparable of variable that.category does not match with type java.awt.geom.Rectangle2D of variable that.dataArea
    3Expression that.category cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.dataArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type java.lang.Comparable of variable that.category does not match with type java.awt.geom.Rectangle2D of variable that.dataArea
    6Type org.jfree.text.TextBlock of variable this.label does not match with type java.awt.geom.Rectangle2D of variable this.plotArea
    7Type org.jfree.text.TextBlock of variable that.label does not match with type java.awt.geom.Rectangle2D of variable that.plotArea
    8Expression that.label cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.plotArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type org.jfree.text.TextBlock of variable that.label does not match with type java.awt.geom.Rectangle2D of variable that.plotArea
    11Expression ObjectUtilities.equal(this.labelAnchor,that.labelAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Not all possible execution flows end in a return statement