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 AbstractCategoryItemLabelGenerator)) { return false; } AbstractCategoryItemLabelGenerator that = (AbstractCategoryItemLabelGenerator) obj; if (!this.labelFormat.equals(that.labelFormat)) { return false; } if (!ObjectUtilities.equal(this.dateFormat, that.dateFormat)) { return false; } if (!ObjectUtilities.equal(this.numberFormat, that.numberFormat)) { 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/AbstractCategoryItemLabelGenerator.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 AbstractCategoryItemLabelGenerator)) {
5
            return false;   
5
            return false;
6
        }
6
        }
7
        ChartEntity that = (ChartEntity
7
        
8
        AbstractCategoryItemLabelGenerator that 
8
) obj;
9
            = (AbstractCategoryItemLabelGenerator) obj;
9
        if (!this.area.equals(that.area)) {
10
        if (!this.labelFormat.equals(that.labelFormat)) {
10
            return false;   
11
            return false;
11
        }
12
        }
12
        if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText)) {
13
        if (!ObjectUtilities.equal(this.dateFormat, that.dateFormat)) {
13
            return false;   
14
            return false;
14
        }
15
        }
15
        if (!ObjectUtilities.equal(this.urlText, that.urlText)) {
16
        if (!ObjectUtilities.equal(this.numberFormat, that.numberFormat)) {
16
            return false;   
17
            return false;
17
        }
18
        }
18
        return true;
19
        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.3
Clones locationClones are in different classes
Number of node comparisons62
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.5
    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 AbstractCategoryItemLabelGenerator))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.entity.ChartEntityorg.jfree.chart.labels.AbstractCategoryItemLabelGeneratorSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof AbstractCategoryItemLabelGenerator))
    4
    return false;
    4
    return false;
    5
    ChartEntity that = (ChartEntity)obj;
    5
    ChartEntity that = (ChartEntity)obj;
    5
    AbstractCategoryItemLabelGenerator that = (AbstractCategoryItemLabelGenerator)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.entity.ChartEntityorg.jfree.chart.labels.AbstractCategoryItemLabelGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.entity.ChartEntityorg.jfree.chart.labels.AbstractCategoryItemLabelGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.entity.ChartEntityorg.jfree.chart.labels.AbstractCategoryItemLabelGeneratorSUBCLASS_TYPE_MISMATCH
    5
    AbstractCategoryItemLabelGenerator that = (AbstractCategoryItemLabelGenerator)obj;
    6
    if (!this.area.equals(that.area))
    6
    if (!this.area.equals(that.area))
    6
    if (!this.labelFormat.equals(that.labelFormat))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.entity.ChartEntityorg.jfree.chart.labels.AbstractCategoryItemLabelGeneratorSUBCLASS_TYPE_MISMATCH
    arealabelFormatVARIABLE_NAME_MISMATCH
    java.awt.Shapejava.lang.StringVARIABLE_TYPE_MISMATCH
    arealabelFormatVARIABLE_NAME_MISMATCH
    java.awt.Shapejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression that.area cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.labelFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.awt.Shape of variable that.area does not match with type java.lang.String of variable that.labelFormat
    • Make classes java.awt.Shape and java.lang.String extend a common superclass
    Type java.awt.Shape of variable this.area does not match with type java.lang.String of variable this.labelFormat
    • Make classes java.awt.Shape and java.lang.String extend a common superclass
    6
    if (!this.labelFormat.equals(that.labelFormat))
    7
    return false;
    7
    return false;
    8
    if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText))
    8
    if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText))
    8
    if (!ObjectUtilities.equal(this.dateFormat, that.dateFormat))
    Differences
    Expression1Expression2Difference
    toolTipTextdateFormatVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.text.DateFormatVARIABLE_TYPE_MISMATCH
    org.jfree.chart.entity.ChartEntityorg.jfree.chart.labels.AbstractCategoryItemLabelGeneratorSUBCLASS_TYPE_MISMATCH
    toolTipTextdateFormatVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.text.DateFormatVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable this.toolTipText does not match with type java.text.DateFormat of variable this.dateFormat
    • Make classes java.lang.String and java.text.DateFormat extend a common superclass
    Expression that.toolTipText cannot be unified with expression that.dateFormat , 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.dateFormat 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.DateFormat of variable that.dateFormat
    • Make classes java.lang.String and java.text.DateFormat extend a common superclass
    8
    if (!ObjectUtilities.equal(this.dateFormat, that.dateFormat))
    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.numberFormat, that.numberFormat))
    Differences
    Expression1Expression2Difference
    urlTextnumberFormatVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.text.NumberFormatVARIABLE_TYPE_MISMATCH
    org.jfree.chart.entity.ChartEntityorg.jfree.chart.labels.AbstractCategoryItemLabelGeneratorSUBCLASS_TYPE_MISMATCH
    urlTextnumberFormatVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.text.NumberFormatVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable this.urlText does not match with type java.text.NumberFormat of variable this.numberFormat
    • Make classes java.lang.String and java.text.NumberFormat extend a common superclass
    Expression that.urlText cannot be unified with expression that.numberFormat , 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.numberFormat 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.NumberFormat of variable that.numberFormat
    • Make classes java.lang.String and java.text.NumberFormat extend a common superclass
    10
    if (!ObjectUtilities.equal(this.numberFormat, that.numberFormat))
    11
    return false;
    11
    return false;
    12
    return true;
    12
    return true;
    Precondition Violations (14)
    Row Violation
    1Expression that.area cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression that.labelFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type java.awt.Shape of variable that.area does not match with type java.lang.String of variable that.labelFormat
    4Type java.awt.Shape of variable this.area does not match with type java.lang.String of variable this.labelFormat
    5Type java.lang.String of variable this.toolTipText does not match with type java.text.DateFormat of variable this.dateFormat
    6Expression that.toolTipText cannot be unified with expression that.dateFormat , because common superclass type java.io.Serializable cannot be passed as an argument to public static boolean equal(java.lang.Object, java.lang.Object)
    7Expression that.toolTipText cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.dateFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Type java.lang.String of variable that.toolTipText does not match with type java.text.DateFormat of variable that.dateFormat
    10Type java.lang.String of variable this.urlText does not match with type java.text.NumberFormat of variable this.numberFormat
    11Expression that.urlText cannot be unified with expression that.numberFormat , because common superclass type java.io.Serializable cannot be passed as an argument to public static boolean equal(java.lang.Object, java.lang.Object)
    12Expression that.urlText cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression that.numberFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Type java.lang.String of variable that.urlText does not match with type java.text.NumberFormat of variable that.numberFormat