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 (obj == this) { return true; } if (!(obj instanceof StandardCategoryURLGenerator)) { return false; } StandardCategoryURLGenerator that = (StandardCategoryURLGenerator) obj; if (!ObjectUtilities.equal(this.prefix, that.prefix)) { return false; } if (!ObjectUtilities.equal(this.seriesParameterName, that.seriesParameterName)) { return false; } if (!ObjectUtilities.equal(this.categoryParameterName, that.categoryParameterName)) { 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/urls/StandardCategoryURLGenerator.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 LegendItemEntity)) {
4
        if (!(obj instanceof StandardCategoryURLGenerator)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        LegendItemEntity that = (LegendItemEntity) obj;
7
        StandardCategoryURLGenerator that = (StandardCategoryURLGenerator) obj;
8
        if (!ObjectUtilities.equal(this.seriesKey, that.seriesKey)) {
8
        if (!ObjectUtilities.equal(this.prefix, that.prefix)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.seriesIndex != that.seriesIndex
11
        if (!ObjectUtilities.equal(this.seriesParameterName,
12
) {
12
                that.seriesParameterName)) {
13
            return false;   
13
            return false;
14
        }
14
        }
15
        if (!ObjectUtilities.equal(this.dataset,
15
        if (!ObjectUtilities.equal(this.categoryParameterName,
16
 that.dataset)) {
16
                that.categoryParameterName)) {
17
            return false;
17
            return false;
18
        }
18
        }
19
        return super.equals(obj);
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.1
Clones locationClones are in different classes
Number of node comparisons47
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    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.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (obj == this)
    1
    if (obj == this)
    2
    return true;
    2
    return true;
    3
    if (!(obj instanceof LegendItemEntity))
    3
    if (!(obj instanceof LegendItemEntity))
    3
    if (!(obj instanceof StandardCategoryURLGenerator))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.entity.LegendItemEntityorg.jfree.chart.urls.StandardCategoryURLGeneratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.entity.LegendItemEntity does not match with type org.jfree.chart.urls.StandardCategoryURLGenerator
    • Make classes org.jfree.chart.entity.LegendItemEntity and org.jfree.chart.urls.StandardCategoryURLGenerator extend a common superclass
    3
    if (!(obj instanceof StandardCategoryURLGenerator))
    4
    return false;
    4
    return false;
                                                                                                                                                  
    5
    StandardCategoryURLGenerator that = (StandardCategoryURLGenerator)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.prefix, that.prefix))
    Differences
    Expression1Expression2Difference
    seriesKeyprefixVARIABLE_NAME_MISMATCH
    java.lang.Comparablejava.lang.StringVARIABLE_TYPE_MISMATCH
    org.jfree.chart.entity.LegendItemEntityorg.jfree.chart.urls.StandardCategoryURLGeneratorVARIABLE_TYPE_MISMATCH
    seriesKeyprefixVARIABLE_NAME_MISMATCH
    java.lang.Comparablejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Comparable of variable this.seriesKey does not match with type java.lang.String of variable this.prefix
    • Make classes java.lang.Comparable and java.lang.String extend a common superclass
    Type java.lang.Comparable of variable that.seriesKey does not match with type java.lang.String of variable that.prefix
    • Make classes org.jfree.chart.entity.LegendItemEntity and org.jfree.chart.urls.StandardCategoryURLGenerator extend a common superclass
    Expression that.seriesKey cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.prefix 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.lang.String of variable that.prefix
    • Make classes java.lang.Comparable and java.lang.String extend a common superclass
    6
    if (!ObjectUtilities.equal(this.prefix, that.prefix))
    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.seriesParameterName, that.seriesParameterName))
    Differences
    Expression1Expression2Difference
    datasetseriesParameterNameVARIABLE_NAME_MISMATCH
    org.jfree.data.general.Datasetjava.lang.StringVARIABLE_TYPE_MISMATCH
    org.jfree.chart.entity.LegendItemEntityorg.jfree.chart.urls.StandardCategoryURLGeneratorVARIABLE_TYPE_MISMATCH
    datasetseriesParameterNameVARIABLE_NAME_MISMATCH
    org.jfree.data.general.Datasetjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.data.general.Dataset of variable this.dataset does not match with type java.lang.String of variable this.seriesParameterName
    • Make classes org.jfree.data.general.Dataset and java.lang.String extend a common superclass
    Type org.jfree.data.general.Dataset of variable that.dataset does not match with type java.lang.String of variable that.seriesParameterName
    • Make classes org.jfree.chart.entity.LegendItemEntity and org.jfree.chart.urls.StandardCategoryURLGenerator extend a common superclass
    Expression that.dataset cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.seriesParameterName 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.lang.String of variable that.seriesParameterName
    • Make classes org.jfree.data.general.Dataset and java.lang.String extend a common superclass
    8
    if (!ObjectUtilities.equal(this.seriesParameterName, that.seriesParameterName))
    11
    return false;
    9
    return false;
    Precondition Violations (14)
    Row Violation
    1Type org.jfree.chart.entity.LegendItemEntity does not match with type org.jfree.chart.urls.StandardCategoryURLGenerator
    2Type java.lang.Comparable of variable this.seriesKey does not match with type java.lang.String of variable this.prefix
    3Type java.lang.Comparable of variable that.seriesKey does not match with type java.lang.String of variable that.prefix
    4Expression that.seriesKey cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.prefix 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.lang.String of variable that.prefix
    7Unmatched return false;
    8Type org.jfree.data.general.Dataset of variable this.dataset does not match with type java.lang.String of variable this.seriesParameterName
    9Type org.jfree.data.general.Dataset of variable that.dataset does not match with type java.lang.String of variable that.seriesParameterName
    10Expression that.dataset cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.seriesParameterName 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.lang.String of variable that.seriesParameterName
    13Not all possible execution flows end in a return statement
    14The refactoring of the clones is infeasible, because classes org.jfree.chart.entity.LegendItemEntity and org.jfree.chart.urls.StandardCategoryURLGenerator do not have a common superclass