if (obj == this) { return true; } if (!(obj instanceof LegendItemEntity)) { return false; } LegendItemEntity that = (LegendItemEntity) obj; if (!ObjectUtilities.equal(this.seriesKey, that.seriesKey)) { return false; } if (this.seriesIndex != that.seriesIndex) { return false; } if (!ObjectUtilities.equal(this.dataset, that.dataset)) { return false; } return super.equals(obj);
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/entity/LegendItemEntity.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 (obj == this) {
1
if (this == obj) {
2
            return true;   
2
            return true;   
3
        }
3
        }
4
        if (!(obj instanceof LegendItemEntity)) {
4
        if (!(obj instanceof PlotRenderingInfo)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        LegendItemEntity that = (LegendItemEntity) obj;
7
        PlotRenderingInfo that = (PlotRenderingInfo) obj;
8
        if (!ObjectUtilities.equal(this.seriesKey, that.seriesKey)) {
8
        if (!ObjectUtilities.equal(this.dataArea, that.dataArea)) {
9
            return false;
9
            return false;   
10
        }
10
        }
11
        if (this.seriesIndex != that.seriesIndex) {
11
        if (!ObjectUtilities.equal(this.plotArea, that.plotArea)) {
12
            return false;   
12
            return false;   
13
        }
13
        }
14
        if (!ObjectUtilities.equal(this.dataset, that.dataset)) {
14
        if (!ObjectUtilities.equal(this.subplotInfo, that.subplotInfo)) {
15
            return false;
15
            return false;   
16
        }
16
        }
17
        return super.equals(obj);
17
        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)2.1
Clones locationClones are in different classes
Number of node comparisons44
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    if (!(obj instanceof LegendItemEntity))
    3
    if (!(obj instanceof LegendItemEntity))
    3
    if (!(obj instanceof PlotRenderingInfo))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.entity.LegendItemEntityorg.jfree.chart.plot.PlotRenderingInfoVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.entity.LegendItemEntity does not match with type org.jfree.chart.plot.PlotRenderingInfo
    • Make classes org.jfree.chart.entity.LegendItemEntity and org.jfree.chart.plot.PlotRenderingInfo extend a common superclass
    3
    if (!(obj instanceof PlotRenderingInfo))
    4
    return false;
    4
    return false;
                                                                                                      
    5
    PlotRenderingInfo that = (PlotRenderingInfo)obj;
    5
    LegendItemEntity that = (LegendItemEntity)obj;
                                                                                                  
    6
    if (!ObjectUtilities.equal(this.seriesKey, that.seriesKey))
    6
    if (!ObjectUtilities.equal(this.seriesKey, that.seriesKey))
    6
    if (!ObjectUtilities.equal(this.dataArea, that.dataArea))
    Differences
    Expression1Expression2Difference
    seriesKeydataAreaVARIABLE_NAME_MISMATCH
    java.lang.Comparablejava.awt.geom.Rectangle2DVARIABLE_TYPE_MISMATCH
    org.jfree.chart.entity.LegendItemEntityorg.jfree.chart.plot.PlotRenderingInfoVARIABLE_TYPE_MISMATCH
    seriesKeydataAreaVARIABLE_NAME_MISMATCH
    java.lang.Comparablejava.awt.geom.Rectangle2DVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Comparable of variable this.seriesKey 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.seriesKey does not match with type java.awt.geom.Rectangle2D of variable that.dataArea
    • Make classes org.jfree.chart.entity.LegendItemEntity and org.jfree.chart.plot.PlotRenderingInfo extend a common superclass
    Expression that.seriesKey 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.seriesKey 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))
    7
    return false;
    7
    return false;
    8
    if (this.seriesIndex != that.seriesIndex)
                                                                                          
    9
    return false;
    9
    return false;
    Preondition Violations
    Unmatched return false;
                                    
    10
    if (!ObjectUtilities.equal(this.dataset, that.dataset))
    10
    if (!ObjectUtilities.equal(this.dataset, that.dataset))
    8
    if (!ObjectUtilities.equal(this.plotArea, that.plotArea))
    Differences
    Expression1Expression2Difference
    datasetplotAreaVARIABLE_NAME_MISMATCH
    org.jfree.data.general.Datasetjava.awt.geom.Rectangle2DVARIABLE_TYPE_MISMATCH
    org.jfree.chart.entity.LegendItemEntityorg.jfree.chart.plot.PlotRenderingInfoVARIABLE_TYPE_MISMATCH
    datasetplotAreaVARIABLE_NAME_MISMATCH
    org.jfree.data.general.Datasetjava.awt.geom.Rectangle2DVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.data.general.Dataset of variable this.dataset does not match with type java.awt.geom.Rectangle2D of variable this.plotArea
    • Make classes org.jfree.data.general.Dataset and java.awt.geom.Rectangle2D extend a common superclass
    Type org.jfree.data.general.Dataset of variable that.dataset does not match with type java.awt.geom.Rectangle2D of variable that.plotArea
    • Make classes org.jfree.chart.entity.LegendItemEntity and org.jfree.chart.plot.PlotRenderingInfo extend a common superclass
    Expression that.dataset 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.data.general.Dataset of variable that.dataset does not match with type java.awt.geom.Rectangle2D of variable that.plotArea
    • Make classes org.jfree.data.general.Dataset and java.awt.geom.Rectangle2D extend a common superclass
    8
    if (!ObjectUtilities.equal(this.plotArea, that.plotArea))
    11
    return false;
    9
    return false;
    Precondition Violations (13)
    Row Violation
    1Type org.jfree.chart.entity.LegendItemEntity does not match with type org.jfree.chart.plot.PlotRenderingInfo
    2Type java.lang.Comparable of variable this.seriesKey does not match with type java.awt.geom.Rectangle2D of variable this.dataArea
    3Type java.lang.Comparable of variable that.seriesKey does not match with type java.awt.geom.Rectangle2D of variable that.dataArea
    4Expression that.seriesKey cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.dataArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type java.lang.Comparable of variable that.seriesKey does not match with type java.awt.geom.Rectangle2D of variable that.dataArea
    7Unmatched return false;
    8Type org.jfree.data.general.Dataset of variable this.dataset does not match with type java.awt.geom.Rectangle2D of variable this.plotArea
    9Type org.jfree.data.general.Dataset of variable that.dataset does not match with type java.awt.geom.Rectangle2D of variable that.plotArea
    10Expression that.dataset cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.plotArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type org.jfree.data.general.Dataset of variable that.dataset does not match with type java.awt.geom.Rectangle2D of variable that.plotArea
    13Not all possible execution flows end in a return statement