if (obj == this) { return true; } if (!(obj instanceof LineBorder)) { return false; } LineBorder that = (LineBorder) obj; if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (!ObjectUtilities.equal(this.stroke, that.stroke)) { return false; } if (!this.insets.equals(that.insets)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof ChartEntity)) { return false; } ChartEntity that = (ChartEntity) obj; if (!this.area.equals(that.area)) { return false; } if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText)) { return false; } if (!ObjectUtilities.equal(this.urlText, that.urlText)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/block/LineBorder.java File path: /jfreechart-1.0.10/src/org/jfree/chart/entity/ChartEntity.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 (obj == this) {
2
            return true;   
2
            return true;   
3
        }
3
        }
4
        if (!(obj instanceof LineBorder)) {
4
        if (!(obj instanceof ChartEntity)) {
5
            return false;   
5
            return false;   
6
        }
6
        }
7
        LineBorder that = (LineBorder) obj;
7
        ChartEntity that = (ChartEntity) obj;
8
        if (!PaintUtilities.equal(this.paint, that.paint)) {
8
        if (!this.area.equals(that.area)) {
9
            return false;
9
            return false;   
10
        }
10
        }
11
        if (!ObjectUtilities.equal(this.stroke, that.stroke)) {
11
        if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText)) {
12
            return false;
12
            return false;   
13
        }
13
        }
14
        if (!this.insets.equals(that.insets)) {
14
        if (!ObjectUtilities.equal(this.urlText, that.urlText)) {
15
            return false;
15
            return false;   
16
        }
16
        }
17
        return true;
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.0
Clones locationClones are in different classes
Number of node comparisons62
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)3.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (obj == this)
    1
    if (obj == this)
    2
    return true;
    2
    return true;
    3
    if (!(obj instanceof LineBorder))
    3
    if (!(obj instanceof LineBorder))
    3
    if (!(obj instanceof ChartEntity))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.LineBorderorg.jfree.chart.entity.ChartEntityVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.block.LineBorder does not match with type org.jfree.chart.entity.ChartEntity
    • Make classes org.jfree.chart.block.LineBorder and org.jfree.chart.entity.ChartEntity extend a common superclass
    3
    if (!(obj instanceof ChartEntity))
    4
    return false;
    4
    return false;
                                                                              
    5
    ChartEntity that = (ChartEntity)obj;
    5
    LineBorder that = (LineBorder)obj;
                                                                          
    6
    if (!PaintUtilities.equal(this.paint, that.paint))
    6
    if (!PaintUtilities.equal(this.paint, that.paint))
    8
    if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText))
    Differences
    Expression1Expression2Difference
    painttoolTipTextVARIABLE_NAME_MISMATCH
    java.awt.Paintjava.lang.StringVARIABLE_TYPE_MISMATCH
    org.jfree.chart.block.LineBorderorg.jfree.chart.entity.ChartEntityVARIABLE_TYPE_MISMATCH
    painttoolTipTextVARIABLE_NAME_MISMATCH
    java.awt.Paintjava.lang.StringVARIABLE_TYPE_MISMATCH
    org.jfree.util.PaintUtilitiesorg.jfree.util.ObjectUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Paint of variable this.paint does not match with type java.lang.String of variable this.toolTipText
    • Make classes java.awt.Paint and java.lang.String extend a common superclass
    Type java.awt.Paint of variable that.paint does not match with type java.lang.String of variable that.toolTipText
    • Make classes org.jfree.chart.block.LineBorder and org.jfree.chart.entity.ChartEntity extend a common superclass
    Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.toolTipText cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.awt.Paint of variable that.paint does not match with type java.lang.String of variable that.toolTipText
    • Make classes java.awt.Paint and java.lang.String extend a common superclass
    Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities
    • Make classes org.jfree.util.PaintUtilities and org.jfree.util.ObjectUtilities extend a common superclass
    8
    if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText))
    7
    return false;
    9
    return false;
    8
    if (!ObjectUtilities.equal(this.stroke, that.stroke))
    8
    if (!ObjectUtilities.equal(this.stroke, that.stroke))
    10
    if (!ObjectUtilities.equal(this.urlText, that.urlText))
    Differences
    Expression1Expression2Difference
    strokeurlTextVARIABLE_NAME_MISMATCH
    java.awt.Strokejava.lang.StringVARIABLE_TYPE_MISMATCH
    org.jfree.chart.block.LineBorderorg.jfree.chart.entity.ChartEntityVARIABLE_TYPE_MISMATCH
    strokeurlTextVARIABLE_NAME_MISMATCH
    java.awt.Strokejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Stroke of variable this.stroke does not match with type java.lang.String of variable this.urlText
    • Make classes java.awt.Stroke and java.lang.String extend a common superclass
    Type java.awt.Stroke of variable that.stroke does not match with type java.lang.String of variable that.urlText
    • Make classes org.jfree.chart.block.LineBorder and org.jfree.chart.entity.ChartEntity extend a common superclass
    Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.urlText cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.awt.Stroke of variable that.stroke does not match with type java.lang.String of variable that.urlText
    • Make classes java.awt.Stroke and java.lang.String extend a common superclass
    10
    if (!ObjectUtilities.equal(this.urlText, that.urlText))
    9
    return false;
    11
    return false;
    10
    if (!this.insets.equals(that.insets))
    10
    if (!this.insets.equals(that.insets))
    6
    if (!this.area.equals(that.area))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.LineBorderorg.jfree.chart.entity.ChartEntityVARIABLE_TYPE_MISMATCH
    insetsareaVARIABLE_NAME_MISMATCH
    org.jfree.ui.RectangleInsetsjava.awt.ShapeVARIABLE_TYPE_MISMATCH
    insetsareaVARIABLE_NAME_MISMATCH
    org.jfree.ui.RectangleInsetsjava.awt.ShapeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.RectangleInsets of variable that.insets does not match with type java.awt.Shape of variable that.area
    • Make classes org.jfree.chart.block.LineBorder and org.jfree.chart.entity.ChartEntity extend a common superclass
    Expression that.insets cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.area cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.ui.RectangleInsets of variable that.insets does not match with type java.awt.Shape of variable that.area
    • Make classes org.jfree.ui.RectangleInsets and java.awt.Shape extend a common superclass
    Type org.jfree.ui.RectangleInsets of variable this.insets does not match with type java.awt.Shape of variable this.area
    • Make classes org.jfree.ui.RectangleInsets and java.awt.Shape extend a common superclass
    6
    if (!this.area.equals(that.area))
    11
    return false;
    7
    return false;
    12
    return true;
    12
    return true;
    Precondition Violations (17)
    Row Violation
    1Type org.jfree.chart.block.LineBorder does not match with type org.jfree.chart.entity.ChartEntity
    2Type java.awt.Paint of variable this.paint does not match with type java.lang.String of variable this.toolTipText
    3Type java.awt.Paint of variable that.paint does not match with type java.lang.String of variable that.toolTipText
    4Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.toolTipText cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type java.awt.Paint of variable that.paint does not match with type java.lang.String of variable that.toolTipText
    7Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities
    8Type java.awt.Stroke of variable this.stroke does not match with type java.lang.String of variable this.urlText
    9Type java.awt.Stroke of variable that.stroke does not match with type java.lang.String of variable that.urlText
    10Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.urlText cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type java.awt.Stroke of variable that.stroke does not match with type java.lang.String of variable that.urlText
    13Type org.jfree.ui.RectangleInsets of variable that.insets does not match with type java.awt.Shape of variable that.area
    14Expression that.insets cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.area cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type org.jfree.ui.RectangleInsets of variable that.insets does not match with type java.awt.Shape of variable that.area
    17Type org.jfree.ui.RectangleInsets of variable this.insets does not match with type java.awt.Shape of variable this.area