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 TextTitle)) { return false; } TextTitle that = (TextTitle) obj; if (!ObjectUtilities.equal(this.text, that.text)) { return false; } if (!ObjectUtilities.equal(this.font, that.font)) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (this.textAlignment != that.textAlignment) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (this.maximumLinesToDisplay != that.maximumLinesToDisplay) { return false; } if (this.expandToFitSpace != that.expandToFitSpace) { return false; } if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText)) { return false; } if (!ObjectUtilities.equal(this.urlText, that.urlText)) { 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/title/TextTitle.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 26 Number of AST nodes: 24
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 TextTitle)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        DefaultDrawingSupplier that = (DefaultDrawingSupplier) obj;
7
        TextTitle that = (TextTitle) obj;
8
        if (!Arrays.equals(this.paintSequence, that.paintSequence)) {
8
        if (!ObjectUtilities.equal(this.text, that.text)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.paintIndex != that.paintIndex) {
11
        if (!ObjectUtilities.equal(this.font, that.font)) {
12
            return false;   
12
            return false;
13
        }
13
        }
14
        if (!Arrays.equals(this.outlinePaintSequence, 
14
        if (!PaintUtilities.equal(this.
15
                that.outlinePaintSequence)) {
15
paint, that.paint)) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (this.outlinePaintIndex != that.outlinePaintIndex) {
18
        if (this.textAlignment != that.textAlignment) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (!Arrays.equals(this.strokeSequence, that.strokeSequence)) {
21
        if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {
22
            return false;
22
            return false;
23
        }
23
        }
24
        if (this.strokeIndex != that.strokeIndex) {
24
        if (this.maximumLinesToDisplay != that.maximumLinesToDisplay) {
25
            return false;   
25
            return false;
26
        }
26
        }
27
        if (!Arrays.equals(this.outlineStrokeSequence, 
27
        if (
28
                that.outlineStrokeSequence)) {
28
this.expandToFitSpace != that.expandToFitSpace) {
29
            return false;
29
            return false;
30
        }
30
        }
31
        if (this.outlineStrokeIndex != that.outlineStrokeIndex) {
31
        if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText)) {
32
            return false;   
32
            return false;
33
        }
33
        }
34
        if (!equalShapes(this.shapeSequence, that.shapeSequence)) {
34
        if (!
35
            return false;
36
        }
37
        if (this.shapeIndex != that.shapeIndex) {
35
ObjectUtilities.equal(this.urlText, that.urlText)) {
38
            return false;
36
            return false;
39
        }
37
        }
40
        return true;
38
        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 comparisons181
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment10
    Number of unmapped statements in the second code fragment6
    Time elapsed for statement mapping (ms)14.6
    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 TextTitle))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof TextTitle))
    4
    return false;
    4
    return false;
    5
    DefaultDrawingSupplier that = (DefaultDrawingSupplier)obj;
    5
    DefaultDrawingSupplier that = (DefaultDrawingSupplier)obj;
    5
    TextTitle that = (TextTitle)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    5
    TextTitle that = (TextTitle)obj;
                                                                                                        
    6
    if (!ObjectUtilities.equal(this.text, that.text))
    Preondition Violations
    Unmatched statement if(!ObjectUtilities.equal(this.text,that.text)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    if (!ObjectUtilities.equal(this.text, that.text))
                                    
    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))
    Preondition Violations
    Unmatched statement if(!Arrays.equals(this.paintSequence,that.paintSequence)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                            
    7
    return false;
    7
    return false;
    Preondition Violations
    Unmatched return false;
                                    
                                                                                                        
    8
    if (!ObjectUtilities.equal(this.font, that.font))
    Preondition Violations
    Unmatched statement if(!ObjectUtilities.equal(this.font,that.font)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    if (!ObjectUtilities.equal(this.font, that.font))
                                    
    9
    return false;
    Preondition Violations
    Unmatched return false;
    9
    return false;
                                                                                                            
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    Preondition Violations
    Unmatched statement if(!PaintUtilities.equal(this.paint,that.paint)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
                                      
    11
    return false;
    Preondition Violations
    Unmatched return false;
    11
    return false;
    8
    if (this.paintIndex != that.paintIndex)
    8
    if (this.paintIndex != that.paintIndex)
    16
    if (this.maximumLinesToDisplay != that.maximumLinesToDisplay)
    Differences
    Expression1Expression2Difference
    paintIndexmaximumLinesToDisplayVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    paintIndexmaximumLinesToDisplayVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.paintIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.maximumLinesToDisplay cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    if (this.maximumLinesToDisplay != that.maximumLinesToDisplay)
    9
    return false;
    17
    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.textAlignment != that.textAlignment)
    Differences
    Expression1Expression2Difference
    outlinePaintIndextextAlignmentVARIABLE_NAME_MISMATCH
    intorg.jfree.ui.HorizontalAlignmentVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    outlinePaintIndextextAlignmentVARIABLE_NAME_MISMATCH
    intorg.jfree.ui.HorizontalAlignmentVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.outlinePaintIndex does not match with type org.jfree.ui.HorizontalAlignment of variable this.textAlignment
    Expression that.outlinePaintIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.textAlignment 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 org.jfree.ui.HorizontalAlignment of variable that.textAlignment
    12
    if (this.textAlignment != that.textAlignment)
    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)
    18
    if (this.expandToFitSpace != that.expandToFitSpace)
    Differences
    Expression1Expression2Difference
    strokeIndexexpandToFitSpaceVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    strokeIndexexpandToFitSpaceVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.strokeIndex does not match with type boolean of variable this.expandToFitSpace
    Expression that.strokeIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.expandToFitSpace 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 boolean of variable that.expandToFitSpace
    18
    if (this.expandToFitSpace != that.expandToFitSpace)
    17
    return false;
    19
    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)
    Preondition Violations
    Unmatched statement if(this.outlineStrokeIndex != that.outlineStrokeIndex) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                        
    21
    return false;
    21
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    22
    if (!equalShapes(this.shapeSequence, that.shapeSequence))
    22
    if (!equalShapes(this.shapeSequence, that.shapeSequence))
    14
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    Differences
    Expression1Expression2Difference
    equalShapes(this.shapeSequence,that.shapeSequence)PaintUtilities.equal(this.backgroundPaint,that.backgroundPaint)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 PaintUtilities.equal(this.backgroundPaint,that.backgroundPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    23
    return false;
    15
    return false;
    Precondition Violations (31)
    Row Violation
    1Unmatched statement if(!ObjectUtilities.equal(this.text,that.text)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched return false;
    3Unmatched statement if(!Arrays.equals(this.paintSequence,that.paintSequence)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched return false;
    5Unmatched statement if(!ObjectUtilities.equal(this.font,that.font)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched return false;
    7Unmatched statement if(!PaintUtilities.equal(this.paint,that.paint)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched return false;
    9Expression that.paintIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.maximumLinesToDisplay cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Unmatched 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
    12Unmatched return false;
    13Type int of variable this.outlinePaintIndex does not match with type org.jfree.ui.HorizontalAlignment of variable this.textAlignment
    14Expression that.outlinePaintIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.textAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type int of variable that.outlinePaintIndex does not match with type org.jfree.ui.HorizontalAlignment of variable that.textAlignment
    17Unmatched 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
    18Unmatched return false;
    19Type int of variable this.strokeIndex does not match with type boolean of variable this.expandToFitSpace
    20Expression that.strokeIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression that.expandToFitSpace cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Type int of variable that.strokeIndex does not match with type boolean of variable that.expandToFitSpace
    23Unmatched 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
    24Unmatched return false;
    25Unmatched statement if(this.outlineStrokeIndex != that.outlineStrokeIndex) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    26Unmatched return false;
    27Expression equalShapes(this.shapeSequence,that.shapeSequence) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    28Expression PaintUtilities.equal(this.backgroundPaint,that.backgroundPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    29Clone fragment #1 returns variable that with type org.jfree.chart.plot.DefaultDrawingSupplier , while Clone fragment #2 returns variable that with type org.jfree.chart.title.TextTitle
    30Not all possible execution flows end in a return statement
    31The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.DefaultDrawingSupplier and org.jfree.chart.title.TextTitle do not have a common superclass