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);
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/renderer/xy/StandardXYItemRenderer.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: 28 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 StandardXYItemRenderer)) {
4
        if (!(obj instanceof TextTitle)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        StandardXYItemRenderer that = (StandardXYItemRenderer) obj;
7
        
8
        if (this.baseShapesVisible != that.baseShapesVisible) {
9
            return false;
10
        }
11
        if (this.plotLines != that.plotLines) {
12
            return false;
13
        }
14
        if (this.plotImages != that.plotImages) {
15
            return false;
16
        }
17
        if (this.plotDiscontinuous != that.plotDiscontinuous
8
TextTitle that = (TextTitle) obj;
9
        if (!ObjectUtilities.equal(this.text, that.text)) {
10
            return false;
11
        }
18
) {
12
        if (!ObjectUtilities.equal(this.font, that.font)) {
19
            return false;
13
            return false;
20
        }
14
        }
21
        if (this.gapThresholdType != that.gapThresholdType) {
15
        if (!PaintUtilities.equal(this.paint, that.paint)) {
22
            return false;
16
            return false;
23
        }
17
        }
24
        if (this.gapThreshold != that.gapThreshold) {
18
        if (this.textAlignment != that.textAlignment) {
25
            return false;
19
            return false;
26
        }
20
        }
27
        if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled)) {
21
        if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {
28
            return false;
22
            return false;
29
        }
23
        }
30
        if (!this.seriesShapesFilled.equals(that.seriesShapesFilled)) {
24
        if (this.maximumLinesToDisplay != that.maximumLinesToDisplay) {
31
            return false;
25
            return false;
32
        }
26
        }
33
        if (this.baseShapesFilled != that.baseShapesFilled) {
27
        if (this.expandToFitSpace != that.expandToFitSpace) {
34
            return false;
28
            return false;
35
        }
29
        }
36
        if (this.drawSeriesLineAsPath != that.drawSeriesLineAsPath) {
30
        if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText)) {
37
            return false;
31
            return false;
38
        }
32
        }
39
        if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) {
33
        if (!ObjectUtilities.equal(this.urlText, that.urlText)) {
40
            return false;
34
            return false;
41
        }
35
        }
42
        return super.equals(obj);
36
        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)14.7
Clones locationClones are in different classes
Number of node comparisons207
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements17
    Number of unmapped statements in the first code fragment10
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)16.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 StandardXYItemRenderer))
    3
    if (!(obj instanceof StandardXYItemRenderer))
    3
    if (!(obj instanceof TextTitle))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.StandardXYItemRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof TextTitle))
    4
    return false;
    4
    return false;
    5
    StandardXYItemRenderer that = (StandardXYItemRenderer)obj;
    5
    StandardXYItemRenderer that = (StandardXYItemRenderer)obj;
    5
    TextTitle that = (TextTitle)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.StandardXYItemRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.StandardXYItemRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.StandardXYItemRendererorg.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 (this.baseShapesVisible != that.baseShapesVisible)
    6
    if (this.baseShapesVisible != that.baseShapesVisible)
    18
    if (this.expandToFitSpace != that.expandToFitSpace)
    Differences
    Expression1Expression2Difference
    baseShapesVisibleexpandToFitSpaceVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.xy.StandardXYItemRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    baseShapesVisibleexpandToFitSpaceVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.baseShapesVisible 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
    18
    if (this.expandToFitSpace != that.expandToFitSpace)
    7
    return false;
    19
    return false;
    8
    if (this.plotLines != that.plotLines)
    8
    if (this.plotLines != that.plotLines)
    12
    if (this.textAlignment != that.textAlignment)
    Differences
    Expression1Expression2Difference
    plotLinestextAlignmentVARIABLE_NAME_MISMATCH
    booleanorg.jfree.ui.HorizontalAlignmentVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.StandardXYItemRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    plotLinestextAlignmentVARIABLE_NAME_MISMATCH
    booleanorg.jfree.ui.HorizontalAlignmentVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.plotLines does not match with type org.jfree.ui.HorizontalAlignment of variable this.textAlignment
    Expression that.plotLines 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 boolean of variable that.plotLines does not match with type org.jfree.ui.HorizontalAlignment of variable that.textAlignment
    12
    if (this.textAlignment != that.textAlignment)
    9
    return false;
    13
    return false;
    10
    if (this.plotImages != that.plotImages)
    10
    if (this.plotImages != that.plotImages)
    16
    if (this.maximumLinesToDisplay != that.maximumLinesToDisplay)
    Differences
    Expression1Expression2Difference
    plotImagesmaximumLinesToDisplayVARIABLE_NAME_MISMATCH
    booleanintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.StandardXYItemRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    plotImagesmaximumLinesToDisplayVARIABLE_NAME_MISMATCH
    booleanintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.plotImages does not match with type int of variable this.maximumLinesToDisplay
    Expression that.plotImages 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
    Type boolean of variable that.plotImages does not match with type int of variable that.maximumLinesToDisplay
    16
    if (this.maximumLinesToDisplay != that.maximumLinesToDisplay)
    11
    return false;
    17
    return false;
    12
    if (this.plotDiscontinuous != that.plotDiscontinuous)
    12
    if (this.plotDiscontinuous != that.plotDiscontinuous)
    Preondition Violations
    Unmatched statement if(this.plotDiscontinuous != that.plotDiscontinuous) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                    
    13
    return false;
    13
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    14
    if (this.gapThresholdType != that.gapThresholdType)
    14
    if (this.gapThresholdType != that.gapThresholdType)
    Preondition Violations
    Unmatched statement if(this.gapThresholdType != that.gapThresholdType) 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.gapThreshold != that.gapThreshold)
    16
    if (this.gapThreshold != that.gapThreshold)
    Preondition Violations
    Unmatched statement if(this.gapThreshold != that.gapThreshold) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                
    17
    return false;
    17
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    18
    if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled))
    18
    if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled))
    8
    if (!ObjectUtilities.equal(this.font, that.font))
    Differences
    Expression1Expression2Difference
    shapesFilledfontVARIABLE_NAME_MISMATCH
    java.lang.Booleanjava.awt.FontVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.StandardXYItemRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    shapesFilledfontVARIABLE_NAME_MISMATCH
    java.lang.Booleanjava.awt.FontVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Boolean of variable this.shapesFilled does not match with type java.awt.Font of variable this.font
    • Make classes java.lang.Boolean and java.awt.Font extend a common superclass
    Expression that.shapesFilled cannot be unified with expression that.font , because common superclass type java.io.Serializable cannot be passed as an argument to public static boolean equal(java.lang.Object, java.lang.Object)
    Expression that.shapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.font cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.Boolean of variable that.shapesFilled does not match with type java.awt.Font of variable that.font
    • Make classes java.lang.Boolean and java.awt.Font extend a common superclass
    8
    if (!ObjectUtilities.equal(this.font, that.font))
    19
    return false;
    9
    return false;
    20
    if (!this.seriesShapesFilled.equals(that.seriesShapesFilled))
    20
    if (!this.seriesShapesFilled.equals(that.seriesShapesFilled))
    14
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    Differences
    Expression1Expression2Difference
    this.seriesShapesFilled.equals(that.seriesShapesFilled)PaintUtilities.equal(this.backgroundPaint,that.backgroundPaint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.seriesShapesFilled.equals(that.seriesShapesFilled) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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))
    21
    return false;
    15
    return false;
    22
    if (this.baseShapesFilled != that.baseShapesFilled)
    22
    if (this.baseShapesFilled != that.baseShapesFilled)
    Preondition Violations
    Unmatched statement if(this.baseShapesFilled != that.baseShapesFilled) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                
    23
    return false;
    23
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    24
    if (this.drawSeriesLineAsPath != that.drawSeriesLineAsPath)
    24
    if (this.drawSeriesLineAsPath != that.drawSeriesLineAsPath)
    Preondition Violations
    Unmatched statement if(this.drawSeriesLineAsPath != that.drawSeriesLineAsPath) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                
    25
    return false;
    25
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    26
    if (!ShapeUtilities.equal(this.legendLine, that.legendLine))
    26
    if (!ShapeUtilities.equal(this.legendLine, that.legendLine))
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    Differences
    Expression1Expression2Difference
    legendLinepaintVARIABLE_NAME_MISMATCH
    java.awt.Shapejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.StandardXYItemRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    legendLinepaintVARIABLE_NAME_MISMATCH
    java.awt.Shapejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ShapeUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Shape of variable this.legendLine does not match with type java.awt.Paint of variable this.paint
    • Make classes java.awt.Shape and java.awt.Paint extend a common superclass
    Expression that.legendLine cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.awt.Shape of variable that.legendLine does not match with type java.awt.Paint of variable that.paint
    • Make classes java.awt.Shape and java.awt.Paint extend a common superclass
    Type org.jfree.util.ShapeUtilities does not match with type org.jfree.util.PaintUtilities
    • Make classes org.jfree.util.ShapeUtilities and org.jfree.util.PaintUtilities extend a common superclass
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    27
    return false;
    11
    return false;
    Precondition Violations (37)
    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;
    3Expression that.baseShapesVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.expandToFitSpace cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type boolean of variable this.plotLines does not match with type org.jfree.ui.HorizontalAlignment of variable this.textAlignment
    6Expression that.plotLines cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.textAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type boolean of variable that.plotLines does not match with type org.jfree.ui.HorizontalAlignment of variable that.textAlignment
    9Type boolean of variable this.plotImages does not match with type int of variable this.maximumLinesToDisplay
    10Expression that.plotImages cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.maximumLinesToDisplay cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type boolean of variable that.plotImages does not match with type int of variable that.maximumLinesToDisplay
    13Unmatched statement if(this.plotDiscontinuous != that.plotDiscontinuous) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    14Unmatched return false;
    15Unmatched statement if(this.gapThresholdType != that.gapThresholdType) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    16Unmatched return false;
    17Unmatched statement if(this.gapThreshold != that.gapThreshold) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    18Unmatched return false;
    19Type java.lang.Boolean of variable this.shapesFilled does not match with type java.awt.Font of variable this.font
    20Expression that.shapesFilled cannot be unified with expression that.font , because common superclass type java.io.Serializable cannot be passed as an argument to public static boolean equal(java.lang.Object, java.lang.Object)
    21Expression that.shapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Expression that.font cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Type java.lang.Boolean of variable that.shapesFilled does not match with type java.awt.Font of variable that.font
    24Expression this.seriesShapesFilled.equals(that.seriesShapesFilled) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Expression PaintUtilities.equal(this.backgroundPaint,that.backgroundPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    26Unmatched statement if(this.baseShapesFilled != that.baseShapesFilled) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    27Unmatched return false;
    28Unmatched statement if(this.drawSeriesLineAsPath != that.drawSeriesLineAsPath) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    29Unmatched return false;
    30Type java.awt.Shape of variable this.legendLine does not match with type java.awt.Paint of variable this.paint
    31Expression that.legendLine cannot be parameterized, because it has dependencies to/from statements that will be extracted
    32Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    33Type java.awt.Shape of variable that.legendLine does not match with type java.awt.Paint of variable that.paint
    34Type org.jfree.util.ShapeUtilities does not match with type org.jfree.util.PaintUtilities
    35Clone fragment #1 returns variable that with type org.jfree.chart.renderer.xy.StandardXYItemRenderer , while Clone fragment #2 returns variable that with type org.jfree.chart.title.TextTitle
    36Not all possible execution flows end in a return statement
    37The refactoring of the clones is infeasible, because classes org.jfree.chart.renderer.xy.StandardXYItemRenderer and org.jfree.chart.title.TextTitle do not have a common superclass