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;
if (obj == this) { return true; } if (!(obj instanceof DefaultIntervalCategoryDataset)) { return false; } DefaultIntervalCategoryDataset that = (DefaultIntervalCategoryDataset) obj; if (!Arrays.equals(this.seriesKeys, that.seriesKeys)) { return false; } if (!Arrays.equals(this.categoryKeys, that.categoryKeys)) { return false; } if (!equal(this.startData, that.startData)) { return false; } if (!equal(this.endData, that.endData)) { return false; } // seem to be the same... 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/data/category/DefaultIntervalCategoryDataset.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 14 Number of AST nodes: 14
1
if (this == obj) {
1
if (obj == this) {
2
            return true;   
2
            return true;
3
        }
3
        }
4
        if (obj instanceof Tick) {
4
        if (!(obj instanceof 
5
            Tick t = (Tick) obj;   
6
            if (!ObjectUtilitie
5
DefaultIntervalCategoryDataset)) {
6
            return false;
7
        }
8
        DefaultIntervalCategoryDataset that 
9
                = (DefaultIntervalCategoryDataset) obj;
7
s.equal(this.text, t.text)) {
10
        if (!Arrays.equals(this.seriesKeys, that.seriesKeys)) {
8
                return false;   
11
            return false;
9
   
10
         }
12
        }
11
            if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) {
13
        if (!Arrays.equals(this.categoryKeys, that.categoryKeys)) {
12
                return false;   
14
            return false;
13
  
14
          }
15
        }
15
            if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor)) {
16
        if (!equal(this.startData, that.startData)) {
16
                return false;   
17
            return false;
17
  
18
          }
18
        }
19
            if (!(this.angle == t.angle)) {
19
        if (!equal(this.endData, that.endData)) {
20
                return false;   
20
            return false;
21
    
22
        }
21
        }
23
            return true;
22
        
24
        }
23
// seem to be the same...
25
        return false;
24
        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)4.7
Clones locationClones are in different classes
Number of node comparisons31
  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.5
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    4
    Tick t = (Tick)obj;
                                            
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    3
    if (!(obj instanceof DefaultIntervalCategoryDataset))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.text,t.text)(obj instanceof DefaultIntervalCategoryDataset)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.text,t.text) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    if (!(obj instanceof DefaultIntervalCategoryDataset))
    6
    return false;
    4
    return false;
                                                                                                                                                          
    5
    DefaultIntervalCategoryDataset that = (DefaultIntervalCategoryDataset)obj;
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
                                                                                                                          
    8
    return false;
    8
    return false;
    Preondition Violations
    Unmatched 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))
    11
    if (!(this.angle == t.angle))
    6
    if (!Arrays.equals(this.seriesKeys, that.seriesKeys))
    Differences
    Expression1Expression2Difference
    (this.angle == t.angle)Arrays.equals(this.seriesKeys,that.seriesKeys)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression (this.angle == t.angle) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression Arrays.equals(this.seriesKeys,that.seriesKeys) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (!Arrays.equals(this.seriesKeys, that.seriesKeys))
    12
    return false;
    7
    return false;
    Precondition Violations (6)
    Row Violation
    1Expression ObjectUtilities.equal(this.text,t.text) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Unmatched return false;
    3Unmatched return false;
    4Expression (this.angle == t.angle) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression Arrays.equals(this.seriesKeys,that.seriesKeys) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Not all possible execution flows end in a return statement