if (obj == this) { return true; } if (!(obj instanceof MonthDateFormat)) { return false; } if (!super.equals(obj)) { return false; } MonthDateFormat that = (MonthDateFormat) obj; if (!Arrays.equals(this.months, that.months)) { return false; } if (!Arrays.equals(this.showYear, that.showYear)) { return false; } if (!this.yearFormatter.equals(that.yearFormatter)) { return false; } return true;
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/MonthDateFormat.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 MonthDateFormat)) {
4
        if (obj instanceof Tick) {
5
            return false;
5
            
6
    
6
Tick t = (Tick) obj;   
7
    }
7
    
8
        if (!super.equals(obj)) {
8
        if (!ObjectUtilities.equal(this.text, t.text)) {
9
            return false;
9
                return false;
10
        }
10
   
11
        MonthDateFormat that = (MonthDateFormat) obj;
11
        
12
        if (!Array
12
    }
13
s.equals(this.months, that.months)) {
13
            if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) {
14
            return false;
14
                return false;
15
   
15
        }
16
            }
16
        if (!Arrays.equals(this.showYear, that.showYear)) {
17
            if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor)) {
17
            return false;
18
                return false;
19
   
18
        }
20
            }
19
        if (!this.yearFormatter.equals(that.yearFormatter)) {
21
            if (!(this.angle == t.angle)) {
20
            return false;
22
                return false;   
21
        }
23
            }
22
        return true;
24
            return true;
25
        }
26
        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 comparisons52
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)2.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                            
    4
    Tick t = (Tick)obj;
                                                                                                  
    5
    if (!ObjectUtilities.equal(this.text, t.text))
                                    
    6
    return false;
    Preondition Violations
    Unmatched return false;
    6
    return false;
    3
    if (!(obj instanceof MonthDateFormat))
    3
    if (!(obj instanceof MonthDateFormat))
    11
    if (!(this.angle == t.angle))
    Differences
    Expression1Expression2Difference
    obj instanceof MonthDateFormatthis.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
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    Differences
    Expression1Expression2Difference
    super.equals(obj)ObjectUtilities.equal(this.textAnchor,t.textAnchor)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
    Super method call if(!super.equals(obj)) cannot be extracted from method
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    6
    return false;
    8
    return false;
    7
    MonthDateFormat that = (MonthDateFormat)obj;
                                                                                              
    8
    if (!Arrays.equals(this.months, that.months))
                                                                                                
    9
    return false;
    9
    return false;
    Preondition Violations
    Unmatched return false;
                                    
    10
    if (!Arrays.equals(this.showYear, that.showYear))
                                                                                                          
    11
    return false;
    11
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    12
    if (!this.yearFormatter.equals(that.yearFormatter))
    12
    if (!this.yearFormatter.equals(that.yearFormatter))
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    Differences
    Expression1Expression2Difference
    this.yearFormatter.equals(that.yearFormatter)ObjectUtilities.equal(this.rotationAnchor,t.rotationAnchor)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.yearFormatter.equals(that.yearFormatter) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ObjectUtilities.equal(this.rotationAnchor,t.rotationAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    13
    return false;
    10
    return false;
    Precondition Violations (9)
    Row Violation
    1Unmatched return false;
    2Expression this.angle == t.angle 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
    4Super method call if(!super.equals(obj)) cannot be extracted from method
    5Unmatched return false;
    6Unmatched return false;
    7Expression this.yearFormatter.equals(that.yearFormatter) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression ObjectUtilities.equal(this.rotationAnchor,t.rotationAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Not all possible execution flows end in a return statement