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; }
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/axis/Tick.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: 11 Number of AST nodes: 12
1
if (obj instanceof Tick) {
1
if (obj == this) {
2
            Tick t = (Tick) obj;
2
            return true;
3
   
3
        }
4
            if (!ObjectUtilities.equal(this.text, t.text)) {
4
        if (!(obj instanceof StandardCategoryURLGenerator)) {
5
                return false;
5
            return false;
6
   
6
        }
7
            }
7
        
8
    
8
StandardCategoryURLGenerator that = (StandardCategoryURLGenerator) obj;
9
        if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) {
9
        if (!ObjectUtilities.equal(this.prefix, that.prefix)) {
10
                return false;   
10
            return false;
11
            }
11
        
12
    
12
}
13
        if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor
13
        if (!ObjectUtilities.equal(this.seriesParameterName,
14
)) {
14
                that.seriesParameterName)) {
15
                return false;   
15
            return false;
16
   
17
         }
16
        }
18
            if (!(this.angle == t.angl
17
        if (!ObjectUtilities.equal(this.categoryParameterName,
19
e)) {
18
                that.categoryParameterName)) {
20
                return false;   
19
            return false;
21
    
22
        }
20
        }
23
            return true;
21
        return true;
24
        }
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.6
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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    Tick t = (Tick)obj;
                                            
                                                                                                                                                  
    5
    StandardCategoryURLGenerator that = (StandardCategoryURLGenerator)obj;
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    6
    if (!ObjectUtilities.equal(this.prefix, that.prefix))
    Differences
    Expression1Expression2Difference
    textprefixVARIABLE_NAME_MISMATCH
    tthatVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Tickorg.jfree.chart.urls.StandardCategoryURLGeneratorVARIABLE_TYPE_MISMATCH
    textprefixVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression t.text 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.String of variable t.text does not match with type java.lang.String of variable that.prefix
    • Make classes org.jfree.chart.axis.Tick and org.jfree.chart.urls.StandardCategoryURLGenerator extend a common superclass
    Expression t.text 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
    6
    if (!ObjectUtilities.equal(this.prefix, that.prefix))
    6
    return false;
    7
    return false;
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    8
    if (!ObjectUtilities.equal(this.seriesParameterName, that.seriesParameterName))
    Differences
    Expression1Expression2Difference
    textAnchorseriesParameterNameVARIABLE_NAME_MISMATCH
    org.jfree.ui.TextAnchorjava.lang.StringVARIABLE_TYPE_MISMATCH
    tthatVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Tickorg.jfree.chart.urls.StandardCategoryURLGeneratorVARIABLE_TYPE_MISMATCH
    textAnchorseriesParameterNameVARIABLE_NAME_MISMATCH
    org.jfree.ui.TextAnchorjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.TextAnchor of variable this.textAnchor does not match with type java.lang.String of variable this.seriesParameterName
    • Make classes org.jfree.ui.TextAnchor and java.lang.String extend a common superclass
    Expression t.textAnchor 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.ui.TextAnchor of variable t.textAnchor does not match with type java.lang.String of variable that.seriesParameterName
    • Make classes org.jfree.chart.axis.Tick and org.jfree.chart.urls.StandardCategoryURLGenerator extend a common superclass
    Expression t.textAnchor 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.ui.TextAnchor of variable t.textAnchor does not match with type java.lang.String of variable that.seriesParameterName
    • Make classes org.jfree.ui.TextAnchor and java.lang.String extend a common superclass
    8
    if (!ObjectUtilities.equal(this.seriesParameterName, that.seriesParameterName))
    8
    return false;
    9
    return false;
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    10
    if (!ObjectUtilities.equal(this.categoryParameterName, that.categoryParameterName))
    Differences
    Expression1Expression2Difference
    rotationAnchorcategoryParameterNameVARIABLE_NAME_MISMATCH
    org.jfree.ui.TextAnchorjava.lang.StringVARIABLE_TYPE_MISMATCH
    tthatVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Tickorg.jfree.chart.urls.StandardCategoryURLGeneratorVARIABLE_TYPE_MISMATCH
    rotationAnchorcategoryParameterNameVARIABLE_NAME_MISMATCH
    org.jfree.ui.TextAnchorjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.TextAnchor of variable this.rotationAnchor does not match with type java.lang.String of variable this.categoryParameterName
    • Make classes org.jfree.ui.TextAnchor and java.lang.String extend a common superclass
    Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.categoryParameterName cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.ui.TextAnchor of variable t.rotationAnchor does not match with type java.lang.String of variable that.categoryParameterName
    • Make classes org.jfree.chart.axis.Tick and org.jfree.chart.urls.StandardCategoryURLGenerator extend a common superclass
    Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.categoryParameterName cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.ui.TextAnchor of variable t.rotationAnchor does not match with type java.lang.String of variable that.categoryParameterName
    • Make classes org.jfree.ui.TextAnchor and java.lang.String extend a common superclass
    10
    if (!ObjectUtilities.equal(this.categoryParameterName, that.categoryParameterName))
    10
    return false;
    11
    return false;
    11
    if (!(this.angle == t.angle))
    11
    if (!(this.angle == t.angle))
    3
    if (!(obj instanceof StandardCategoryURLGenerator))
    Differences
    Expression1Expression2Difference
    this.angle == t.angleobj instanceof StandardCategoryURLGeneratorTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.angle == t.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    if (!(obj instanceof StandardCategoryURLGenerator))
    12
    return false;
    4
    return false;
    Precondition Violations (21)
    Row Violation
    1Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression that.prefix cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type java.lang.String of variable t.text does not match with type java.lang.String of variable that.prefix
    4Expression t.text 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 org.jfree.ui.TextAnchor of variable this.textAnchor does not match with type java.lang.String of variable this.seriesParameterName
    7Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.seriesParameterName cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Type org.jfree.ui.TextAnchor of variable t.textAnchor does not match with type java.lang.String of variable that.seriesParameterName
    10Expression t.textAnchor 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.ui.TextAnchor of variable t.textAnchor does not match with type java.lang.String of variable that.seriesParameterName
    13Type org.jfree.ui.TextAnchor of variable this.rotationAnchor does not match with type java.lang.String of variable this.categoryParameterName
    14Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.categoryParameterName cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type org.jfree.ui.TextAnchor of variable t.rotationAnchor does not match with type java.lang.String of variable that.categoryParameterName
    17Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression that.categoryParameterName cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Type org.jfree.ui.TextAnchor of variable t.rotationAnchor does not match with type java.lang.String of variable that.categoryParameterName
    20Expression this.angle == t.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Not all possible execution flows end in a return statement