if (obj == this) { return true; } if (!(obj instanceof ChartRenderingInfo)) { return false; } ChartRenderingInfo that = (ChartRenderingInfo) obj; if (!ObjectUtilities.equal(this.chartArea, that.chartArea)) { return false; } if (!ObjectUtilities.equal(this.plotInfo, that.plotInfo)) { return false; } if (!ObjectUtilities.equal(this.entities, that.entities)) { return false; } return true;
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;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartRenderingInfo.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryTick.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 12 Number of AST nodes: 12
1
if (obj == this) {
1
if (this == obj) {
2
            return true;   
2
            return true;   
3
        }
3
        }
4
        if (!(obj instanceof ChartRenderingInfo)) {
4
        if (obj instanceof C
5
            return false;
5
ategoryTick && super.equals(obj)) {
6
        }
6
        
7
        ChartRenderingInfo that = (ChartRenderingInfo) obj;
7
    CategoryTick that = (CategoryTick) obj;   
8
        if (!ObjectUtilities.equal(this.chartArea, that.chartArea)) {
8
            if (!ObjectUtilities.equal(this.category, that.category)) {
9
            return false;   
9
                return false;   
10
        }
10
            }
11
        if (!ObjectUtilities.equal(this.plotInfo, that.plotInfo)) {
11
            if (!ObjectUtilities.equal(this.label, that.label)) {
12
            return false;
12
                return false;
13
   
13
        }
14
            }
14
        if (!ObjectUtilities.equal(this.entities, that.entities)) {
15
            if (!ObjectUtilities.equal(this.labelAnchor, that.labelAnchor)) {
15
            return false;
16
                return false;   
16
        }
17
        
18
   }
17
        return true;
19
            return true;
20
        }
21
        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.1
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)1.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                  
    4
    CategoryTick that = (CategoryTick)obj;
    3
    if (!(obj instanceof ChartRenderingInfo))
    3
    if (!(obj instanceof ChartRenderingInfo))
    5
    if (!ObjectUtilities.equal(this.category, that.category))
    Differences
    Expression1Expression2Difference
    (obj instanceof ChartRenderingInfo)ObjectUtilities.equal(this.category,that.category)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.category,that.category) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    if (!ObjectUtilities.equal(this.category, that.category))
    4
    return false;
    6
    return false;
    5
    ChartRenderingInfo that = (ChartRenderingInfo)obj;
                                                                                                          
    6
    if (!ObjectUtilities.equal(this.chartArea, that.chartArea))
    6
    if (!ObjectUtilities.equal(this.chartArea, that.chartArea))
    7
    if (!ObjectUtilities.equal(this.label, that.label))
    Differences
    Expression1Expression2Difference
    chartArealabelVARIABLE_NAME_MISMATCH
    java.awt.geom.Rectangle2Dorg.jfree.text.TextBlockVARIABLE_TYPE_MISMATCH
    org.jfree.chart.ChartRenderingInfoorg.jfree.chart.axis.CategoryTickVARIABLE_TYPE_MISMATCH
    chartArealabelVARIABLE_NAME_MISMATCH
    java.awt.geom.Rectangle2Dorg.jfree.text.TextBlockVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.geom.Rectangle2D of variable this.chartArea does not match with type org.jfree.text.TextBlock of variable this.label
    • Make classes java.awt.geom.Rectangle2D and org.jfree.text.TextBlock extend a common superclass
    Type java.awt.geom.Rectangle2D of variable that.chartArea does not match with type org.jfree.text.TextBlock of variable that.label
    • Make classes org.jfree.chart.ChartRenderingInfo and org.jfree.chart.axis.CategoryTick extend a common superclass
    Expression that.chartArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.label cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.awt.geom.Rectangle2D of variable that.chartArea does not match with type org.jfree.text.TextBlock of variable that.label
    • Make classes java.awt.geom.Rectangle2D and org.jfree.text.TextBlock extend a common superclass
    7
    if (!ObjectUtilities.equal(this.label, that.label))
    7
    return false;
    8
    return false;
    8
    if (!ObjectUtilities.equal(this.plotInfo, that.plotInfo))
    8
    if (!ObjectUtilities.equal(this.plotInfo, that.plotInfo))
    9
    if (!ObjectUtilities.equal(this.labelAnchor, that.labelAnchor))
    Differences
    Expression1Expression2Difference
    plotInfolabelAnchorVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.PlotRenderingInfoorg.jfree.text.TextBlockAnchorVARIABLE_TYPE_MISMATCH
    org.jfree.chart.ChartRenderingInfoorg.jfree.chart.axis.CategoryTickVARIABLE_TYPE_MISMATCH
    plotInfolabelAnchorVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.PlotRenderingInfoorg.jfree.text.TextBlockAnchorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.plot.PlotRenderingInfo of variable this.plotInfo does not match with type org.jfree.text.TextBlockAnchor of variable this.labelAnchor
    • Make classes org.jfree.chart.plot.PlotRenderingInfo and org.jfree.text.TextBlockAnchor extend a common superclass
    Type org.jfree.chart.plot.PlotRenderingInfo of variable that.plotInfo does not match with type org.jfree.text.TextBlockAnchor of variable that.labelAnchor
    • Make classes org.jfree.chart.ChartRenderingInfo and org.jfree.chart.axis.CategoryTick extend a common superclass
    Expression that.plotInfo cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.labelAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.plot.PlotRenderingInfo of variable that.plotInfo does not match with type org.jfree.text.TextBlockAnchor of variable that.labelAnchor
    • Make classes org.jfree.chart.plot.PlotRenderingInfo and org.jfree.text.TextBlockAnchor extend a common superclass
    9
    if (!ObjectUtilities.equal(this.labelAnchor, that.labelAnchor))
    9
    return false;
    10
    return false;
    Precondition Violations (12)
    Row Violation
    1Expression ObjectUtilities.equal(this.category,that.category) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Type java.awt.geom.Rectangle2D of variable this.chartArea does not match with type org.jfree.text.TextBlock of variable this.label
    3Type java.awt.geom.Rectangle2D of variable that.chartArea does not match with type org.jfree.text.TextBlock of variable that.label
    4Expression that.chartArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.label cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type java.awt.geom.Rectangle2D of variable that.chartArea does not match with type org.jfree.text.TextBlock of variable that.label
    7Type org.jfree.chart.plot.PlotRenderingInfo of variable this.plotInfo does not match with type org.jfree.text.TextBlockAnchor of variable this.labelAnchor
    8Type org.jfree.chart.plot.PlotRenderingInfo of variable that.plotInfo does not match with type org.jfree.text.TextBlockAnchor of variable that.labelAnchor
    9Expression that.plotInfo cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.labelAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Type org.jfree.chart.plot.PlotRenderingInfo of variable that.plotInfo does not match with type org.jfree.text.TextBlockAnchor of variable that.labelAnchor
    12Not all possible execution flows end in a return statement