if (obj == this) { return true; } if (!(obj instanceof SymbolAxis)) { return false; } SymbolAxis that = (SymbolAxis) obj; if (!this.symbols.equals(that.symbols)) { return false; } if (this.gridBandsVisible != that.gridBandsVisible) { return false; } if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint)) { return false; } if (!PaintUtilities.equal(this.gridBandAlternatePaint, that.gridBandAlternatePaint)) { return false; } return super.equals(obj);
if (this == obj) { return true; } 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; } return false;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/SymbolAxis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/Tick.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 14 Number of AST nodes: 14
1
if (obj == this) {
1
if (this == obj) {
2
            return true;
2
            return true;   
3
        }
3
        }
4
        if (!(obj instanceof SymbolAxis)) {
4
        if (obj instanceof Tick) {
5
            return false;
5
            
6
        }
7
        SymbolAxis that = (SymbolAxis) obj;
8
        if (!this.symbol
6
Tick t = (Tick) obj;   
9
s.equals(that.symbols)) {
7
            if (!ObjectUtilities.equal(this.text, t.text)) {
10
            return false;
8
                return false;   
11
        }
9
        
10
    }
12
        if (this.gridBandsVisible != that.gridBandsVisible) {
11
            if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) {
13
            return false;
12
                return false;
13
   
14
        }
14
            }
15
        if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint)) {
15
            if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor)) {
16
            return false;
16
                return false;   
17
        }
17
         
18
   }
18
        if (!PaintUtilities.equal(this.gridBandAlternatePaint, 
19
            if (!
19
                that.gridBandAlternatePaint)) {
20
(this.angle == t.angle)) {
21
                return false;   
22
            }
20
            return false;
23
            return true;
21
        }
24
        }
22
        return super.equals(obj);
25
        return false;
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 comparisons55
  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)4.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                            
    4
    Tick t = (Tick)obj;
    3
    if (!(obj instanceof SymbolAxis))
    3
    if (!(obj instanceof SymbolAxis))
    11
    if (!(this.angle == t.angle))
    Differences
    Expression1Expression2Difference
    obj instanceof SymbolAxisthis.angle == t.angleTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.angle == t.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11
    if (!(this.angle == t.angle))
    4
    return false;
    12
    return false;
    5
    SymbolAxis that = (SymbolAxis)obj;
                                                                          
    6
    if (!this.symbols.equals(that.symbols))
    6
    if (!this.symbols.equals(that.symbols))
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    Differences
    Expression1Expression2Difference
    this.symbols.equals(that.symbols)ObjectUtilities.equal(this.textAnchor,t.textAnchor)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.symbols.equals(that.symbols) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ObjectUtilities.equal(this.textAnchor,t.textAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    7
    return false;
    8
    return false;
    8
    if (this.gridBandsVisible != that.gridBandsVisible)
                                                                                                              
    9
    return false;
    9
    return false;
    Preondition Violations
    Unmatched return false;
                                    
    10
    if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint))
    10
    if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint))
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    Differences
    Expression1Expression2Difference
    gridBandPaintrotationAnchorVARIABLE_NAME_MISMATCH
    java.awt.Paintorg.jfree.ui.TextAnchorVARIABLE_TYPE_MISMATCH
    thattVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.SymbolAxisorg.jfree.chart.axis.TickVARIABLE_TYPE_MISMATCH
    gridBandPaintrotationAnchorVARIABLE_NAME_MISMATCH
    java.awt.Paintorg.jfree.ui.TextAnchorVARIABLE_TYPE_MISMATCH
    org.jfree.util.PaintUtilitiesorg.jfree.util.ObjectUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Paint of variable this.gridBandPaint does not match with type org.jfree.ui.TextAnchor of variable this.rotationAnchor
    • Make classes java.awt.Paint and org.jfree.ui.TextAnchor extend a common superclass
    Expression that.gridBandPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.awt.Paint of variable that.gridBandPaint does not match with type org.jfree.ui.TextAnchor of variable t.rotationAnchor
    • Make classes org.jfree.chart.axis.SymbolAxis and org.jfree.chart.axis.Tick extend a common superclass
    Expression that.gridBandPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.awt.Paint of variable that.gridBandPaint does not match with type org.jfree.ui.TextAnchor of variable t.rotationAnchor
    • Make classes java.awt.Paint and org.jfree.ui.TextAnchor 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
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    11
    return false;
    10
    return false;
    12
    if (!PaintUtilities.equal(this.gridBandAlternatePaint, that.gridBandAlternatePaint))
    12
    if (!PaintUtilities.equal(this.gridBandAlternatePaint, that.gridBandAlternatePaint))
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    Differences
    Expression1Expression2Difference
    gridBandAlternatePainttextVARIABLE_NAME_MISMATCH
    java.awt.Paintjava.lang.StringVARIABLE_TYPE_MISMATCH
    thattVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.SymbolAxisorg.jfree.chart.axis.TickVARIABLE_TYPE_MISMATCH
    gridBandAlternatePainttextVARIABLE_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.gridBandAlternatePaint does not match with type java.lang.String of variable this.text
    • Make classes java.awt.Paint and java.lang.String extend a common superclass
    Expression that.gridBandAlternatePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.awt.Paint of variable that.gridBandAlternatePaint does not match with type java.lang.String of variable t.text
    • Make classes org.jfree.chart.axis.SymbolAxis and org.jfree.chart.axis.Tick extend a common superclass
    Expression that.gridBandAlternatePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.awt.Paint of variable that.gridBandAlternatePaint does not match with type java.lang.String of variable t.text
    • 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
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    13
    return false;
    6
    return false;
    Precondition Violations (21)
    Row Violation
    1Expression this.angle == t.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression this.symbols.equals(that.symbols) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression ObjectUtilities.equal(this.textAnchor,t.textAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Unmatched return false;
    5Type java.awt.Paint of variable this.gridBandPaint does not match with type org.jfree.ui.TextAnchor of variable this.rotationAnchor
    6Expression that.gridBandPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type java.awt.Paint of variable that.gridBandPaint does not match with type org.jfree.ui.TextAnchor of variable t.rotationAnchor
    9Expression that.gridBandPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Type java.awt.Paint of variable that.gridBandPaint does not match with type org.jfree.ui.TextAnchor of variable t.rotationAnchor
    12Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities
    13Type java.awt.Paint of variable this.gridBandAlternatePaint does not match with type java.lang.String of variable this.text
    14Expression that.gridBandAlternatePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type java.awt.Paint of variable that.gridBandAlternatePaint does not match with type java.lang.String of variable t.text
    17Expression that.gridBandAlternatePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Type java.awt.Paint of variable that.gridBandAlternatePaint does not match with type java.lang.String of variable t.text
    20Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities
    21Not all possible execution flows end in a return statement