if (this == obj) { return true; } if (!(obj instanceof CategoryLabelPositions)) { return false; } CategoryLabelPositions that = (CategoryLabelPositions) obj; if (!this.positionForAxisAtTop.equals(that.positionForAxisAtTop)) { return false; } if (!this.positionForAxisAtBottom.equals( that.positionForAxisAtBottom)) { return false; } if (!this.positionForAxisAtLeft.equals(that.positionForAxisAtLeft)) { return false; } if (!this.positionForAxisAtRight.equals(that.positionForAxisAtRight)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof IntervalMarker)) { return false; } if (!super.equals(obj)) { return false; } IntervalMarker that = (IntervalMarker) obj; if (this.startValue != that.startValue) { return false; } if (this.endValue != that.endValue) { return false; } if (!ObjectUtilities.equal(this.gradientPaintTransformer, that.gradientPaintTransformer)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryLabelPositions.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/IntervalMarker.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 CategoryLabelPositions)) {
4
        if (!(obj instanceof IntervalMarker)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        CategoryLabelPositions that = (CategoryLabelPositions) obj;
8
        if (!this.positionForAxisAtTop.equals(that.positionForAxisAtTop)) {
7
        if (!super.equals(obj)) {
9
            return false;
8
            return false;
10
        }
9
        }
11
        if (!this.positionForAxisAtBottom.equals(
10
        
12
                that.positionForAxisAtBottom)
11
IntervalMarker that = (IntervalMarker) obj;
13
) {
12
        if (this.startValue != that.startValue) {
14
            return false;
13
            return false;   
15
        }
14
        }
16
        if (!this.positionForAxisAtLeft.equals(that.positionForAxisAtLeft)) {
15
        if (this.endValue != that.endValue) {
17
            return false;
16
            return false;   
18
        }
17
        }
19
        if (!this.positionForAxisAtRight.equals(that.positionForAxisAtRight
18
        if (!ObjectUtilities.equal(this.gradientPaintTransformer, 
20
)) {
19
                that.gradientPaintTransformer)) {
21
            return false;
20
            return false;   
22
        }
21
        }
23
  
24
        return true;
22
        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.6
Clones locationClones are in different classes
Number of node comparisons55
  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 fragment5
    Time elapsed for statement mapping (ms)6.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    if (!(obj instanceof CategoryLabelPositions))
    3
    if (!(obj instanceof CategoryLabelPositions))
    3
    if (!(obj instanceof IntervalMarker))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryLabelPositionsorg.jfree.chart.plot.IntervalMarkerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.CategoryLabelPositions does not match with type org.jfree.chart.plot.IntervalMarker
    • Make classes org.jfree.chart.axis.CategoryLabelPositions and org.jfree.chart.plot.IntervalMarker extend a common superclass
    3
    if (!(obj instanceof IntervalMarker))
    4
    return false;
    4
    return false;
    5
    CategoryLabelPositions that = (CategoryLabelPositions)obj;
                                                                                                                          
    6
    if (!this.positionForAxisAtTop.equals(that.positionForAxisAtTop))
    6
    if (!this.positionForAxisAtTop.equals(that.positionForAxisAtTop))
    5
    if (!super.equals(obj))
    Differences
    Expression1Expression2Difference
    this.positionForAxisAtTop.equals(that.positionForAxisAtTop)super.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.positionForAxisAtTop.equals(that.positionForAxisAtTop) 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
    5
    if (!super.equals(obj))
    7
    return false;
    6
    return false;
                                                                                          
    7
    IntervalMarker that = (IntervalMarker)obj;
                                                                                      
    8
    if (this.startValue != that.startValue)
                                    
    9
    return false;
    Preondition Violations
    Unmatched return false;
    9
    return false;
                                                                                
    10
    if (this.endValue != that.endValue)
                                      
    11
    return false;
    Preondition Violations
    Unmatched return false;
    11
    return false;
    8
    if (!this.positionForAxisAtBottom.equals(that.positionForAxisAtBottom))
    8
    if (!this.positionForAxisAtBottom.equals(that.positionForAxisAtBottom))
    12
    if (!ObjectUtilities.equal(this.gradientPaintTransformer, that.gradientPaintTransformer))
    Differences
    Expression1Expression2Difference
    this.positionForAxisAtBottom.equals(that.positionForAxisAtBottom)ObjectUtilities.equal(this.gradientPaintTransformer,that.gradientPaintTransformer)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.positionForAxisAtBottom.equals(that.positionForAxisAtBottom) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ObjectUtilities.equal(this.gradientPaintTransformer,that.gradientPaintTransformer) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (!ObjectUtilities.equal(this.gradientPaintTransformer, that.gradientPaintTransformer))
    9
    return false;
    13
    return false;
    Precondition Violations (8)
    Row Violation
    1Type org.jfree.chart.axis.CategoryLabelPositions does not match with type org.jfree.chart.plot.IntervalMarker
    2Expression this.positionForAxisAtTop.equals(that.positionForAxisAtTop) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Super method call if(!super.equals(obj)) cannot be extracted from method
    4Unmatched return false;
    5Unmatched return false;
    6Expression this.positionForAxisAtBottom.equals(that.positionForAxisAtBottom) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression ObjectUtilities.equal(this.gradientPaintTransformer,that.gradientPaintTransformer) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Not all possible execution flows end in a return statement