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 SimpleHistogramDataset)) { return false; } SimpleHistogramDataset that = (SimpleHistogramDataset) obj; if (!this.key.equals(that.key)) { return false; } if (this.adjustForBinSize != that.adjustForBinSize) { return false; } if (!this.bins.equals(that.bins)) { 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/data/statistics/SimpleHistogramDataset.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 10 Number of AST nodes: 12
1
Tick t = (Tick) obj;   
1
if (obj == this) {
2
            return true;
2
    
3
        }
3
        if (!ObjectUtilities.equal(this.text, t.text)) {
4
        if (!(obj instanceof SimpleHistogramDataset)) {
4
                return false;
5
            return false;
5
   
6
   
6
     
7
     }
7
       }
8
       
8
            if (!ObjectUtilities
9
 SimpleHistogramDataset that = (SimpleHistogramDataset) obj;
9
.equal(this.textAnchor, t.textAnchor)) {
10
        if (!this.key.equals(that.key)) {
10
                return false;   
11
            return false;
11
   
12
         }
12
        }
13
            if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor)) {
13
        if (this.adjustForBinSize != that.adjustForBinSize) {
14
                return false;   
14
            return false;
15
            }
15
        }
16
            if (!(this.angle == t.angle)) {
16
        if (!this.bins.equals(that.bins)) {
17
                return false;   
17
            return false;
18
   
19
         }
18
        }
20
            return true;
19
        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)1.1
Clones locationClones are in different classes
Number of node comparisons39
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)3.3
    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 SimpleHistogramDataset))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.text,t.text)(obj instanceof SimpleHistogramDataset)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 SimpleHistogramDataset))
    6
    return false;
    4
    return false;
                                                                                                                          
    5
    SimpleHistogramDataset that = (SimpleHistogramDataset)obj;
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    6
    if (!this.key.equals(that.key))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.textAnchor,t.textAnchor)this.key.equals(that.key)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
    Expression this.key.equals(that.key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (!this.key.equals(that.key))
    8
    return false;
    7
    return false;
                                                                                                              
    8
    if (this.adjustForBinSize != that.adjustForBinSize)
                                    
    9
    return false;
    Preondition Violations
    Unmatched return false;
    9
    return false;
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    10
    if (!this.bins.equals(that.bins))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.rotationAnchor,t.rotationAnchor)this.bins.equals(that.bins)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.rotationAnchor,t.rotationAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.bins.equals(that.bins) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (!this.bins.equals(that.bins))
    10
    return false;
    11
    return false;
    Precondition Violations (7)
    Row Violation
    1Expression ObjectUtilities.equal(this.text,t.text) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression ObjectUtilities.equal(this.textAnchor,t.textAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression this.key.equals(that.key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Unmatched return false;
    5Expression ObjectUtilities.equal(this.rotationAnchor,t.rotationAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression this.bins.equals(that.bins) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Not all possible execution flows end in a return statement