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 StandardXYURLGenerator)) { return false; } StandardXYURLGenerator that = (StandardXYURLGenerator) obj; if (!ObjectUtilities.equal(that.prefix, this.prefix)) { return false; } if (!ObjectUtilities.equal(that.seriesParameterName, this.seriesParameterName)) { return false; } if (!ObjectUtilities.equal(that.itemParameterName, this.itemParameterName)) { 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/StandardXYURLGenerator.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 StandardXYURLGenerator)) {
5
                return false;
5
            return false;
6
   
6
        }
7
            }
7
        
8
    
8
StandardXYURLGenerator that = (StandardXYURLGenerator) obj;
9
        if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) {
9
        if (!ObjectUtilities.equal(that.prefix, this.prefix)) {
10
                return false;   
10
            return false;
11
    
12
        }
11
        }
13
            if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor
12
        if (!ObjectUtilities.equal(that.seriesParameterName, 
14
)) {
13
                this.seriesParameterName)) {
15
                return false;   
14
            return false;
16
            }
15
        
17
            if (!(this.angle == t.angl
16
}
17
        if (!ObjectUtilities.equal(that.itemParameterName, 
18
e)) {
18
                this.itemParameterName)) {
19
                return false;   
19
            return false;
20
            }
20
        }
21
            return true;
21
        return true;
22
        }
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.0
Clones locationClones are in different classes
Number of node comparisons30
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    4
    Tick t = (Tick)obj;
                                            
                                                                                                                          
    5
    StandardXYURLGenerator that = (StandardXYURLGenerator)obj;
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    6
    if (!ObjectUtilities.equal(that.prefix, this.prefix))
    Differences
    Expression1Expression2Difference
    this.textthat.prefixTYPE_COMPATIBLE_REPLACEMENT
    t.textthis.prefixTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression that.prefix 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
    6
    if (!ObjectUtilities.equal(that.prefix, this.prefix))
    6
    return false;
    7
    return false;
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    3
    if (!(obj instanceof StandardXYURLGenerator))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.textAnchor,t.textAnchor)(obj instanceof StandardXYURLGenerator)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.textAnchor,t.textAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    if (!(obj instanceof StandardXYURLGenerator))
    8
    return false;
    4
    return false;
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
                                                                                                                                          
    10
    return false;
    10
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    11
    if (!(this.angle == t.angle))
                                                                    
    12
    return false;
    12
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    Precondition Violations (6)
    Row Violation
    1Expression that.prefix cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression t.text 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;
    5Unmatched return false;
    6Not all possible execution flows end in a return statement