if (obj == this) { return true; } if (!(obj instanceof StatisticalBarRenderer)) { return false; } StatisticalBarRenderer that = (StatisticalBarRenderer) obj; if (!PaintUtilities.equal(this.errorIndicatorPaint, that.errorIndicatorPaint)) { return false; } if (!ObjectUtilities.equal(this.errorIndicatorStroke, that.errorIndicatorStroke)) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof StackedXYAreaRenderer) || !super.equals(obj)) { return false; } StackedXYAreaRenderer that = (StackedXYAreaRenderer) obj; if (!PaintUtilities.equal(this.shapePaint, that.shapePaint)) { return false; } if (!ObjectUtilities.equal(this.shapeStroke, that.shapeStroke)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StatisticalBarRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/StackedXYAreaRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 10 Number of AST nodes: 10
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof StatisticalBarRenderer)) {
4
        if (!(obj instanceof StackedXYAreaRenderer) || !super.equals(obj)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        StatisticalBarRenderer that = (StatisticalBarRenderer) obj;
7
        StackedXYAreaRenderer that = (StackedXYAreaRenderer) obj;
8
        if (!PaintUtilities.equal(this.errorIndicatorPaint,
8
        if (!PaintUtilities.equal(this.
9
                that.errorIndicatorPaint)) {
9
shapePaint, that.shapePaint)) {
10
            return false;
10
            return false;
11
        }
11
        }
12
        if (!ObjectUtilities.equal(this.errorIndicatorStroke,
12
        if (!ObjectUtilities.equal(this.
13
                that.errorIndicatorStroke)) {
13
shapeStroke, that.shapeStroke)) {
14
            return false;
14
            return false;
15
        }
15
        }
16
        return super.equals(obj);
16
        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)2.6
Clones locationClones are in different classes having the same super class
Number of node comparisons29
  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)2.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (obj == this)
    1
    if (obj == this)
    2
    return true;
    2
    return true;
                                                                                                                                            
    3
    if (!(obj instanceof StackedXYAreaRenderer) || !super.equals(obj))
                                    
    4
    return false;
    Preondition Violations
    Unmatched return false;
    4
    return false;
                                                                                                                      
    5
    StackedXYAreaRenderer that = (StackedXYAreaRenderer)obj;
    3
    if (!(obj instanceof StatisticalBarRenderer))
    3
    if (!(obj instanceof StatisticalBarRenderer))
    6
    if (!PaintUtilities.equal(this.shapePaint, that.shapePaint))
    Differences
    Expression1Expression2Difference
    (obj instanceof StatisticalBarRenderer)PaintUtilities.equal(this.shapePaint,that.shapePaint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression PaintUtilities.equal(this.shapePaint,that.shapePaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (!PaintUtilities.equal(this.shapePaint, that.shapePaint))
    4
    return false;
    7
    return false;
    5
    StatisticalBarRenderer that = (StatisticalBarRenderer)obj;
                                                                                                                          
    6
    if (!PaintUtilities.equal(this.errorIndicatorPaint, that.errorIndicatorPaint))
    6
    if (!PaintUtilities.equal(this.errorIndicatorPaint, that.errorIndicatorPaint))
    8
    if (!ObjectUtilities.equal(this.shapeStroke, that.shapeStroke))
    Differences
    Expression1Expression2Difference
    errorIndicatorPaintshapeStrokeVARIABLE_NAME_MISMATCH
    java.awt.Paintjava.awt.StrokeVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.category.StatisticalBarRendererorg.jfree.chart.renderer.xy.StackedXYAreaRendererSUBCLASS_TYPE_MISMATCH
    errorIndicatorPaintshapeStrokeVARIABLE_NAME_MISMATCH
    java.awt.Paintjava.awt.StrokeVARIABLE_TYPE_MISMATCH
    org.jfree.util.PaintUtilitiesorg.jfree.util.ObjectUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Paint of variable this.errorIndicatorPaint does not match with type java.awt.Stroke of variable this.shapeStroke
    • Make classes java.awt.Paint and java.awt.Stroke extend a common superclass
    Expression that.errorIndicatorPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.shapeStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.awt.Paint of variable that.errorIndicatorPaint does not match with type java.awt.Stroke of variable that.shapeStroke
    • Make classes java.awt.Paint and java.awt.Stroke extend a common superclass
    Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities
    • Make classes org.jfree.util.PaintUtilities and org.jfree.util.ObjectUtilities extend a common superclass
    8
    if (!ObjectUtilities.equal(this.shapeStroke, that.shapeStroke))
    7
    return false;
    9
    return false;
    Precondition Violations (8)
    Row Violation
    1Unmatched return false;
    2Expression PaintUtilities.equal(this.shapePaint,that.shapePaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type java.awt.Paint of variable this.errorIndicatorPaint does not match with type java.awt.Stroke of variable this.shapeStroke
    4Expression that.errorIndicatorPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.shapeStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type java.awt.Paint of variable that.errorIndicatorPaint does not match with type java.awt.Stroke of variable that.shapeStroke
    7Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities
    8Not all possible execution flows end in a return statement