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;
if (obj == this) { return true; } if (!(obj instanceof BubbleXYItemLabelGenerator)) { return false; } if (!super.equals(obj)) { return false; } BubbleXYItemLabelGenerator that = (BubbleXYItemLabelGenerator) obj; if (!ObjectUtilities.equal(this.zFormat, that.zFormat)) { return false; } if (!ObjectUtilities.equal(this.zDateFormat, that.zDateFormat)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/entity/ChartEntity.java File path: /jfreechart-1.0.10/src/org/jfree/chart/labels/BubbleXYItemLabelGenerator.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 ChartEntity)) {
4
        if (!(obj instanceof BubbleXYItemLabelGenerator)) {
5
            return false;   
5
            return false;
6
        }
6
        }
7
        ChartEntity that = (ChartEntity) obj;
7
        
8
        if (!this.area.equals(that.area)) {
9
            return false;   
10
        }
8
if (!super.equals(obj)) {
9
            return false;
10
        }
11
        BubbleXYItemLabelGenerator that = (BubbleXYItemLabelGenerator) obj;
11
        if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText)) {
12
        if (!ObjectUtilities.equal(this.zFormat, that.zFormat)) {
12
            return false;   
13
            return false;
13
        }
14
        }
14
        if (!ObjectUtilities.equal(this.urlText, that.urlText)) {
15
        if (!ObjectUtilities.equal(this.zDateFormat, that.zDateFormat)) {
15
            return false;   
16
            return false;
16
        }
17
        }
17
        return true;
18
        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.2
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.1
    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 ChartEntity))
    3
    if (!(obj instanceof ChartEntity))
    3
    if (!(obj instanceof BubbleXYItemLabelGenerator))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.entity.ChartEntityorg.jfree.chart.labels.BubbleXYItemLabelGeneratorSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof BubbleXYItemLabelGenerator))
    4
    return false;
    4
    return false;
    5
    ChartEntity that = (ChartEntity)obj;
                                                                              
    6
    if (!this.area.equals(that.area))
    6
    if (!this.area.equals(that.area))
    5
    if (!super.equals(obj))
    Differences
    Expression1Expression2Difference
    this.area.equals(that.area)super.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.area.equals(that.area) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Super method call if(!super.equals(obj)) cannot be extracted from method
    5
    if (!super.equals(obj))
    7
    return false;
    6
    return false;
                                                                                                                                          
    7
    BubbleXYItemLabelGenerator that = (BubbleXYItemLabelGenerator)obj;
    8
    if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText))
    8
    if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText))
    8
    if (!ObjectUtilities.equal(this.zFormat, that.zFormat))
    Differences
    Expression1Expression2Difference
    toolTipTextzFormatVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.text.NumberFormatVARIABLE_TYPE_MISMATCH
    org.jfree.chart.entity.ChartEntityorg.jfree.chart.labels.BubbleXYItemLabelGeneratorSUBCLASS_TYPE_MISMATCH
    toolTipTextzFormatVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.text.NumberFormatVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable this.toolTipText does not match with type java.text.NumberFormat of variable this.zFormat
    • Make classes java.lang.String and java.text.NumberFormat extend a common superclass
    Expression that.toolTipText cannot be unified with expression that.zFormat , because common superclass type java.io.Serializable cannot be passed as an argument to public static boolean equal(java.lang.Object, java.lang.Object)
    Expression that.toolTipText cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.zFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable that.toolTipText does not match with type java.text.NumberFormat of variable that.zFormat
    • Make classes java.lang.String and java.text.NumberFormat extend a common superclass
    8
    if (!ObjectUtilities.equal(this.zFormat, that.zFormat))
    9
    return false;
    9
    return false;
    10
    if (!ObjectUtilities.equal(this.urlText, that.urlText))
    10
    if (!ObjectUtilities.equal(this.urlText, that.urlText))
    10
    if (!ObjectUtilities.equal(this.zDateFormat, that.zDateFormat))
    Differences
    Expression1Expression2Difference
    urlTextzDateFormatVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.text.DateFormatVARIABLE_TYPE_MISMATCH
    org.jfree.chart.entity.ChartEntityorg.jfree.chart.labels.BubbleXYItemLabelGeneratorSUBCLASS_TYPE_MISMATCH
    urlTextzDateFormatVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.text.DateFormatVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable this.urlText does not match with type java.text.DateFormat of variable this.zDateFormat
    • Make classes java.lang.String and java.text.DateFormat extend a common superclass
    Expression that.urlText cannot be unified with expression that.zDateFormat , because common superclass type java.io.Serializable cannot be passed as an argument to public static boolean equal(java.lang.Object, java.lang.Object)
    Expression that.urlText cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.zDateFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable that.urlText does not match with type java.text.DateFormat of variable that.zDateFormat
    • Make classes java.lang.String and java.text.DateFormat extend a common superclass
    10
    if (!ObjectUtilities.equal(this.zDateFormat, that.zDateFormat))
    11
    return false;
    11
    return false;
    12
    return true;
    12
    return true;
    Precondition Violations (13)
    Row Violation
    1Expression this.area.equals(that.area) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Super method call if(!super.equals(obj)) cannot be extracted from method
    3Type java.lang.String of variable this.toolTipText does not match with type java.text.NumberFormat of variable this.zFormat
    4Expression that.toolTipText cannot be unified with expression that.zFormat , because common superclass type java.io.Serializable cannot be passed as an argument to public static boolean equal(java.lang.Object, java.lang.Object)
    5Expression that.toolTipText cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.zFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Type java.lang.String of variable that.toolTipText does not match with type java.text.NumberFormat of variable that.zFormat
    8Type java.lang.String of variable this.urlText does not match with type java.text.DateFormat of variable this.zDateFormat
    9Expression that.urlText cannot be unified with expression that.zDateFormat , because common superclass type java.io.Serializable cannot be passed as an argument to public static boolean equal(java.lang.Object, java.lang.Object)
    10Expression that.urlText cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.zDateFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type java.lang.String of variable that.urlText does not match with type java.text.DateFormat of variable that.zDateFormat
    13The refactoring of the clones is infeasible, because classes org.jfree.chart.entity.ChartEntity and org.jfree.chart.labels.BubbleXYItemLabelGenerator do not have a common superclass