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 (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; }
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/Tick.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 12 Number of AST nodes: 11
1
if (obj == this) {
1
if (obj instanceof Tick) {
2
            return true;   
2
            Tick t = (Tick) obj;   
3
        }
3
       
4
        if (!(obj instanceof ChartRenderingInfo)) {
4
     if (!ObjectUtilities.equal(this.text, t.text)) {
5
            return false;
5
                return false;
6
   
6
   
7
     }
7
     
8
        ChartRenderingInfo that = (ChartRenderingInfo) obj;
8
       
9
}
9
        if (!ObjectUtilities.equal(this.chartArea, that.chartArea)) {
10
            if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) {
10
            return false;   
11
                return false;   
11
        }
12
            }
12
        if (!ObjectUtilities.equal(this.plotInfo, that.plotInfo)) {
13
            if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor)) {
13
            return false;
14
                return false;
15
   
14
        }
16
            }
15
        if (!ObjectUtilities.equal(this.entities, that.entities)) {
17
            if (!(this.angle == t.angle)) {
16
            return false;
18
                return false;
19
   
17
        }
20
            }
18
        return true;
21
            return true;
22
        }
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.3
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.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                            
    4
    Tick t = (Tick)obj;
    3
    if (!(obj instanceof ChartRenderingInfo))
    3
    if (!(obj instanceof ChartRenderingInfo))
    11
    if (!(this.angle == t.angle))
    Differences
    Expression1Expression2Difference
    obj instanceof ChartRenderingInfothis.angle == t.angleTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.angle == t.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11
    if (!(this.angle == t.angle))
    4
    return false;
    12
    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.textAnchor, t.textAnchor))
    Differences
    Expression1Expression2Difference
    chartAreatextAnchorVARIABLE_NAME_MISMATCH
    java.awt.geom.Rectangle2Dorg.jfree.ui.TextAnchorVARIABLE_TYPE_MISMATCH
    thattVARIABLE_NAME_MISMATCH
    org.jfree.chart.ChartRenderingInfoorg.jfree.chart.axis.TickVARIABLE_TYPE_MISMATCH
    chartAreatextAnchorVARIABLE_NAME_MISMATCH
    java.awt.geom.Rectangle2Dorg.jfree.ui.TextAnchorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.geom.Rectangle2D of variable this.chartArea does not match with type org.jfree.ui.TextAnchor of variable this.textAnchor
    • Make classes java.awt.geom.Rectangle2D and org.jfree.ui.TextAnchor extend a common superclass
    Expression that.chartArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression t.textAnchor 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.ui.TextAnchor of variable t.textAnchor
    • Make classes org.jfree.chart.ChartRenderingInfo and org.jfree.chart.axis.Tick extend a common superclass
    Expression that.chartArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression t.textAnchor 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.ui.TextAnchor of variable t.textAnchor
    • Make classes java.awt.geom.Rectangle2D and org.jfree.ui.TextAnchor extend a common superclass
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    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.rotationAnchor, t.rotationAnchor))
    Differences
    Expression1Expression2Difference
    plotInforotationAnchorVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.PlotRenderingInfoorg.jfree.ui.TextAnchorVARIABLE_TYPE_MISMATCH
    thattVARIABLE_NAME_MISMATCH
    org.jfree.chart.ChartRenderingInfoorg.jfree.chart.axis.TickVARIABLE_TYPE_MISMATCH
    plotInforotationAnchorVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.PlotRenderingInfoorg.jfree.ui.TextAnchorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.plot.PlotRenderingInfo of variable this.plotInfo does not match with type org.jfree.ui.TextAnchor of variable this.rotationAnchor
    • Make classes org.jfree.chart.plot.PlotRenderingInfo and org.jfree.ui.TextAnchor extend a common superclass
    Expression that.plotInfo cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression t.rotationAnchor 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.ui.TextAnchor of variable t.rotationAnchor
    • Make classes org.jfree.chart.ChartRenderingInfo and org.jfree.chart.axis.Tick extend a common superclass
    Expression that.plotInfo cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression t.rotationAnchor 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.ui.TextAnchor of variable t.rotationAnchor
    • Make classes org.jfree.chart.plot.PlotRenderingInfo and org.jfree.ui.TextAnchor extend a common superclass
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    9
    return false;
    10
    return false;
    10
    if (!ObjectUtilities.equal(this.entities, that.entities))
    10
    if (!ObjectUtilities.equal(this.entities, that.entities))
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    Differences
    Expression1Expression2Difference
    entitiestextVARIABLE_NAME_MISMATCH
    org.jfree.chart.entity.EntityCollectionjava.lang.StringVARIABLE_TYPE_MISMATCH
    thattVARIABLE_NAME_MISMATCH
    org.jfree.chart.ChartRenderingInfoorg.jfree.chart.axis.TickVARIABLE_TYPE_MISMATCH
    entitiestextVARIABLE_NAME_MISMATCH
    org.jfree.chart.entity.EntityCollectionjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.entity.EntityCollection of variable this.entities does not match with type java.lang.String of variable this.text
    • Make classes org.jfree.chart.entity.EntityCollection and java.lang.String extend a common superclass
    Expression that.entities cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.entity.EntityCollection of variable that.entities does not match with type java.lang.String of variable t.text
    • Make classes org.jfree.chart.ChartRenderingInfo and org.jfree.chart.axis.Tick extend a common superclass
    Expression that.entities cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.entity.EntityCollection of variable that.entities does not match with type java.lang.String of variable t.text
    • Make classes org.jfree.chart.entity.EntityCollection and java.lang.String extend a common superclass
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    11
    return false;
    6
    return false;
    Precondition Violations (23)
    Row Violation
    1Expression this.angle == t.angle 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.ui.TextAnchor of variable this.textAnchor
    3Expression that.chartArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type java.awt.geom.Rectangle2D of variable that.chartArea does not match with type org.jfree.ui.TextAnchor of variable t.textAnchor
    6Expression that.chartArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type java.awt.geom.Rectangle2D of variable that.chartArea does not match with type org.jfree.ui.TextAnchor of variable t.textAnchor
    9Type org.jfree.chart.plot.PlotRenderingInfo of variable this.plotInfo does not match with type org.jfree.ui.TextAnchor of variable this.rotationAnchor
    10Expression that.plotInfo cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type org.jfree.chart.plot.PlotRenderingInfo of variable that.plotInfo does not match with type org.jfree.ui.TextAnchor of variable t.rotationAnchor
    13Expression that.plotInfo cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type org.jfree.chart.plot.PlotRenderingInfo of variable that.plotInfo does not match with type org.jfree.ui.TextAnchor of variable t.rotationAnchor
    16Type org.jfree.chart.entity.EntityCollection of variable this.entities does not match with type java.lang.String of variable this.text
    17Expression that.entities cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Type org.jfree.chart.entity.EntityCollection of variable that.entities does not match with type java.lang.String of variable t.text
    20Expression that.entities cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Type org.jfree.chart.entity.EntityCollection of variable that.entities does not match with type java.lang.String of variable t.text
    23Not all possible execution flows end in a return statement