if (obj == this) { return true; } if (!(obj instanceof DefaultDrawingSupplier)) { return false; } DefaultDrawingSupplier that = (DefaultDrawingSupplier) obj; if (!Arrays.equals(this.paintSequence, that.paintSequence)) { return false; } if (this.paintIndex != that.paintIndex) { return false; } if (!Arrays.equals(this.outlinePaintSequence, that.outlinePaintSequence)) { return false; } if (this.outlinePaintIndex != that.outlinePaintIndex) { return false; } if (!Arrays.equals(this.strokeSequence, that.strokeSequence)) { return false; } if (this.strokeIndex != that.strokeIndex) { return false; } if (!Arrays.equals(this.outlineStrokeSequence, that.outlineStrokeSequence)) { return false; } if (this.outlineStrokeIndex != that.outlineStrokeIndex) { return false; } if (!equalShapes(this.shapeSequence, that.shapeSequence)) { return false; } if (this.shapeIndex != that.shapeIndex) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof StandardXYItemRenderer)) { return false; } StandardXYItemRenderer that = (StandardXYItemRenderer) obj; if (this.baseShapesVisible != that.baseShapesVisible) { return false; } if (this.plotLines != that.plotLines) { return false; } if (this.plotImages != that.plotImages) { return false; } if (this.plotDiscontinuous != that.plotDiscontinuous) { return false; } if (this.gapThresholdType != that.gapThresholdType) { return false; } if (this.gapThreshold != that.gapThreshold) { return false; } if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled)) { return false; } if (!this.seriesShapesFilled.equals(that.seriesShapesFilled)) { return false; } if (this.baseShapesFilled != that.baseShapesFilled) { return false; } if (this.drawSeriesLineAsPath != that.drawSeriesLineAsPath) { return false; } if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } return super.equals(obj);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/DefaultDrawingSupplier.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/StandardXYItemRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 26 Number of AST nodes: 28
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof DefaultDrawingSupplier)) {
4
        if (!(obj instanceof StandardXYItemRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        DefaultDrawingSupplier that = (DefaultDrawingSupplier) obj;
7
        StandardXYItemRenderer that = (StandardXYItemRenderer) obj;
8
        if (!Arrays.equals(this.paintSequence, that.paintSequence)) {
8
        if (this.baseShapesVisible != that.baseShapesVisible) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.paintIndex != that.paintIndex) {
11
        if (this.plotLines != that.plotLines) {
12
            return false;   
12
            return false;
13
        }
13
        }
14
        if (!Arrays.equals(this.outlinePaintSequence, 
14
        if (
15
                that.outlinePaintSequence)) {
15
this.plotImages != that.plotImages) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (this.outlinePaintIndex != that.outlinePaintIndex) {
18
        if (this.plotDiscontinuous != that.plotDiscontinuous) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (!Arrays.equals(this.strokeSequence, that.strokeSequence)) {
21
        if (this.gapThresholdType != that.gapThresholdType) {
22
            return false;
22
            return false;
23
        }
23
        }
24
        if (this.strokeIndex != that.strokeIndex) {
24
        if (this.gapThreshold != that.gapThreshold) {
25
            return false;   
25
            return false;
26
        }
26
        }
27
        if (!Arrays.equals(this.outlineStrokeSequence, 
27
        if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled)) {
28
            return false;
28
        
29
        }
29
        that.outlineStrokeSequence)) {
30
        if (!this.seriesShapesFilled.equals(that.seriesShapesFilled)) {
30
            return false;
31
            return false;
31
        }
32
        }
32
        if (this.outlineStrokeIndex != that.outlineStrokeIndex) {
33
        if (this.baseShapesFilled != that.baseShapesFilled) {
33
            return false;   
34
            return false;
34
        }
35
        }
35
        if (!equalShapes(this.shapeSequence, that.shapeSequence)) {
36
        if (this.drawSeriesLineAsPath != that.drawSeriesLineAsPath) {
36
            return false;
37
            return false;
37
        }
38
        }
38
        if (this.shapeIndex != that.shapeIndex) {
39
        if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) {
39
            return false;
40
            return false;
40
        }
41
        }
41
        return true;
42
        return super.equals(obj);
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)15.8
Clones locationClones are in different classes
Number of node comparisons235
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements19
    Number of unmapped statements in the first code fragment6
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)13.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 DefaultDrawingSupplier))
    3
    if (!(obj instanceof DefaultDrawingSupplier))
    3
    if (!(obj instanceof StandardXYItemRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof StandardXYItemRenderer))
    4
    return false;
    4
    return false;
    5
    DefaultDrawingSupplier that = (DefaultDrawingSupplier)obj;
    5
    DefaultDrawingSupplier that = (DefaultDrawingSupplier)obj;
    5
    StandardXYItemRenderer that = (StandardXYItemRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    5
    StandardXYItemRenderer that = (StandardXYItemRenderer)obj;
                                                                                                                  
    6
    if (this.baseShapesVisible != that.baseShapesVisible)
    Preondition Violations
    Unmatched statement if(this.baseShapesVisible != that.baseShapesVisible) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    if (this.baseShapesVisible != that.baseShapesVisible)
                                    
    7
    return false;
    Preondition Violations
    Unmatched return false;
    7
    return false;
    6
    if (!Arrays.equals(this.paintSequence, that.paintSequence))
    6
    if (!Arrays.equals(this.paintSequence, that.paintSequence))
    20
    if (!this.seriesShapesFilled.equals(that.seriesShapesFilled))
    Differences
    Expression1Expression2Difference
    Arrays.equals(this.paintSequence,that.paintSequence)this.seriesShapesFilled.equals(that.seriesShapesFilled)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression Arrays.equals(this.paintSequence,that.paintSequence) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.seriesShapesFilled.equals(that.seriesShapesFilled) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20
    if (!this.seriesShapesFilled.equals(that.seriesShapesFilled))
    7
    return false;
    21
    return false;
    8
    if (this.paintIndex != that.paintIndex)
    8
    if (this.paintIndex != that.paintIndex)
    8
    if (this.plotLines != that.plotLines)
    Differences
    Expression1Expression2Difference
    paintIndexplotLinesVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    paintIndexplotLinesVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.paintIndex does not match with type boolean of variable this.plotLines
    Expression that.paintIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.plotLines cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable that.paintIndex does not match with type boolean of variable that.plotLines
    8
    if (this.plotLines != that.plotLines)
    9
    return false;
    9
    return false;
    10
    if (!Arrays.equals(this.outlinePaintSequence, that.outlinePaintSequence))
    10
    if (!Arrays.equals(this.outlinePaintSequence, that.outlinePaintSequence))
    Preondition Violations
    Unmatched statement if(!Arrays.equals(this.outlinePaintSequence,that.outlinePaintSequence)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                          
    11
    return false;
    11
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    12
    if (this.outlinePaintIndex != that.outlinePaintIndex)
    12
    if (this.outlinePaintIndex != that.outlinePaintIndex)
    12
    if (this.plotDiscontinuous != that.plotDiscontinuous)
    Differences
    Expression1Expression2Difference
    outlinePaintIndexplotDiscontinuousVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    outlinePaintIndexplotDiscontinuousVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.outlinePaintIndex does not match with type boolean of variable this.plotDiscontinuous
    Expression that.outlinePaintIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.plotDiscontinuous cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable that.outlinePaintIndex does not match with type boolean of variable that.plotDiscontinuous
    12
    if (this.plotDiscontinuous != that.plotDiscontinuous)
    13
    return false;
    13
    return false;
    14
    if (!Arrays.equals(this.strokeSequence, that.strokeSequence))
    14
    if (!Arrays.equals(this.strokeSequence, that.strokeSequence))
    Preondition Violations
    Unmatched statement if(!Arrays.equals(this.strokeSequence,that.strokeSequence)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                  
    15
    return false;
    15
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    16
    if (this.strokeIndex != that.strokeIndex)
    16
    if (this.strokeIndex != that.strokeIndex)
    16
    if (this.gapThreshold != that.gapThreshold)
    Differences
    Expression1Expression2Difference
    strokeIndexgapThresholdVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    strokeIndexgapThresholdVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.strokeIndex does not match with type double of variable this.gapThreshold
    Expression that.strokeIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.gapThreshold cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable that.strokeIndex does not match with type double of variable that.gapThreshold
    16
    if (this.gapThreshold != that.gapThreshold)
    17
    return false;
    17
    return false;
    18
    if (!Arrays.equals(this.outlineStrokeSequence, that.outlineStrokeSequence))
    18
    if (!Arrays.equals(this.outlineStrokeSequence, that.outlineStrokeSequence))
    Preondition Violations
    Unmatched statement if(!Arrays.equals(this.outlineStrokeSequence,that.outlineStrokeSequence)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                              
    19
    return false;
    19
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    20
    if (this.outlineStrokeIndex != that.outlineStrokeIndex)
    20
    if (this.outlineStrokeIndex != that.outlineStrokeIndex)
    14
    if (this.gapThresholdType != that.gapThresholdType)
    Differences
    Expression1Expression2Difference
    outlineStrokeIndexgapThresholdTypeVARIABLE_NAME_MISMATCH
    intorg.jfree.util.UnitTypeVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    outlineStrokeIndexgapThresholdTypeVARIABLE_NAME_MISMATCH
    intorg.jfree.util.UnitTypeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.outlineStrokeIndex does not match with type org.jfree.util.UnitType of variable this.gapThresholdType
    Expression that.outlineStrokeIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.gapThresholdType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable that.outlineStrokeIndex does not match with type org.jfree.util.UnitType of variable that.gapThresholdType
    14
    if (this.gapThresholdType != that.gapThresholdType)
    21
    return false;
    15
    return false;
    22
    if (!equalShapes(this.shapeSequence, that.shapeSequence))
    22
    if (!equalShapes(this.shapeSequence, that.shapeSequence))
    18
    if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled))
    Differences
    Expression1Expression2Difference
    equalShapes(this.shapeSequence,that.shapeSequence)ObjectUtilities.equal(this.shapesFilled,that.shapesFilled)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression equalShapes(this.shapeSequence,that.shapeSequence) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method equalShapes
    Expression ObjectUtilities.equal(this.shapesFilled,that.shapesFilled) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18
    if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled))
    23
    return false;
    19
    return false;
    24
    if (this.shapeIndex != that.shapeIndex)
    24
    if (this.shapeIndex != that.shapeIndex)
    10
    if (this.plotImages != that.plotImages)
    Differences
    Expression1Expression2Difference
    shapeIndexplotImagesVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    shapeIndexplotImagesVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.shapeIndex does not match with type boolean of variable this.plotImages
    Expression that.shapeIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.plotImages cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable that.shapeIndex does not match with type boolean of variable that.plotImages
    10
    if (this.plotImages != that.plotImages)
    25
    return false;
    11
    return false;
    Precondition Violations (35)
    Row Violation
    1Unmatched statement if(this.baseShapesVisible != that.baseShapesVisible) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched return false;
    3Expression Arrays.equals(this.paintSequence,that.paintSequence) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression this.seriesShapesFilled.equals(that.seriesShapesFilled) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type int of variable this.paintIndex does not match with type boolean of variable this.plotLines
    6Expression that.paintIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.plotLines cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type int of variable that.paintIndex does not match with type boolean of variable that.plotLines
    9Unmatched statement if(!Arrays.equals(this.outlinePaintSequence,that.outlinePaintSequence)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    10Unmatched return false;
    11Type int of variable this.outlinePaintIndex does not match with type boolean of variable this.plotDiscontinuous
    12Expression that.outlinePaintIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression that.plotDiscontinuous cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Type int of variable that.outlinePaintIndex does not match with type boolean of variable that.plotDiscontinuous
    15Unmatched statement if(!Arrays.equals(this.strokeSequence,that.strokeSequence)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    16Unmatched return false;
    17Type int of variable this.strokeIndex does not match with type double of variable this.gapThreshold
    18Expression that.strokeIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression that.gapThreshold cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Type int of variable that.strokeIndex does not match with type double of variable that.gapThreshold
    21Unmatched statement if(!Arrays.equals(this.outlineStrokeSequence,that.outlineStrokeSequence)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    22Unmatched return false;
    23Type int of variable this.outlineStrokeIndex does not match with type org.jfree.util.UnitType of variable this.gapThresholdType
    24Expression that.outlineStrokeIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Expression that.gapThresholdType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    26Type int of variable that.outlineStrokeIndex does not match with type org.jfree.util.UnitType of variable that.gapThresholdType
    27Expression equalShapes(this.shapeSequence,that.shapeSequence) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    28Expression ObjectUtilities.equal(this.shapesFilled,that.shapesFilled) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    29Type int of variable this.shapeIndex does not match with type boolean of variable this.plotImages
    30Expression that.shapeIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    31Expression that.plotImages cannot be parameterized, because it has dependencies to/from statements that will be extracted
    32Type int of variable that.shapeIndex does not match with type boolean of variable that.plotImages
    33Clone fragment #1 returns variable that with type org.jfree.chart.plot.DefaultDrawingSupplier , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.xy.StandardXYItemRenderer
    34Not all possible execution flows end in a return statement
    35The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.DefaultDrawingSupplier and org.jfree.chart.renderer.xy.StandardXYItemRenderer do not have a common superclass