if (obj == this) { return true; } if (!(obj instanceof CandlestickRenderer)) { return false; } CandlestickRenderer that = (CandlestickRenderer) obj; if (this.candleWidth != that.candleWidth) { return false; } if (!PaintUtilities.equal(this.upPaint, that.upPaint)) { return false; } if (!PaintUtilities.equal(this.downPaint, that.downPaint)) { return false; } if (this.drawVolume != that.drawVolume) { return false; } if (this.maxCandleWidthInMilliseconds != that.maxCandleWidthInMilliseconds) { return false; } if (this.autoWidthMethod != that.autoWidthMethod) { return false; } if (this.autoWidthFactor != that.autoWidthFactor) { return false; } if (this.autoWidthGap != that.autoWidthGap) { return false; } if (this.useOutlinePaint != that.useOutlinePaint) { return false; } if (!PaintUtilities.equal(this.volumePaint, that.volumePaint)) { 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/CandlestickRenderer.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 CandlestickRenderer)) {
4
        if (!(obj instanceof TextTitle)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        CandlestickRenderer that = (CandlestickRenderer) obj;
7
        
8
        if (this.candleWidth != that.candleWidth
8
TextTitle that = (TextTitle) obj;
9
) {
9
        if (!ObjectUtilities.equal(this.text, that.text)) {
10
            return false;
10
            return false;
11
        }
11
        }
12
        if (!PaintUtilities.equal(this.upPaint, that.upPaint)) {
12
        if (!ObjectUtilities.equal(this.font, that.font)) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (!PaintUtilities.equal(this.downPaint, that.downPaint)) {
15
        if (!PaintUtilities.equal(this.paint, that.paint)) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (this.drawVolume != that.drawVolume) {
18
        if (this.textAlignment != that.textAlignment) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (this.maxCandleWidthInMilliseconds
21
        if (
22
                != that.maxCandleWidthInMilliseconds) {
22
!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {
23
            return false;
23
            return false;
24
        }
24
        }
25
        if (this.autoWidthMethod != that.autoWidthMethod) {
25
        if (this.maximumLinesToDisplay != that.maximumLinesToDisplay) {
26
            return false;
26
            return false;
27
        }
27
        }
28
        if (this.autoWidthFactor != that.autoWidthFactor) {
28
        if (this.expandToFitSpace != that.expandToFitSpace) {
29
            return false;
29
            return false;
30
        }
30
        }
31
        if (this.autoWidthGap != that.autoWidthGap) {
31
        if (
32
            return false;
33
        }
34
        if (this.useOutlinePaint != that.useOutlinePaint) {
32
!ObjectUtilities.equal(this.toolTipText, that.toolTipText)) {
35
            return false;
33
            return false;
36
        }
34
        }
37
        if (!PaintUtilities.equal(this.volumePaint, that.volumePaint)) {
35
        if (!ObjectUtilities.equal(this.urlText, that.urlText)) {
38
            return false;
36
            return false;
39
        }
37
        }
40
        return super.equals(obj);
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.2
Clones locationClones are in different classes
Number of node comparisons196
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements17
    Number of unmapped statements in the first code fragment8
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)12.3
    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 CandlestickRenderer))
    3
    if (!(obj instanceof CandlestickRenderer))
    3
    if (!(obj instanceof TextTitle))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof TextTitle))
    4
    return false;
    4
    return false;
    5
    CandlestickRenderer that = (CandlestickRenderer)obj;
    5
    CandlestickRenderer that = (CandlestickRenderer)obj;
    5
    TextTitle that = (TextTitle)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.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.candleWidth != that.candleWidth)
    6
    if (this.candleWidth != that.candleWidth)
    12
    if (this.textAlignment != that.textAlignment)
    Differences
    Expression1Expression2Difference
    candleWidthtextAlignmentVARIABLE_NAME_MISMATCH
    doubleorg.jfree.ui.HorizontalAlignmentVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    candleWidthtextAlignmentVARIABLE_NAME_MISMATCH
    doubleorg.jfree.ui.HorizontalAlignmentVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.candleWidth does not match with type org.jfree.ui.HorizontalAlignment of variable this.textAlignment
    Expression that.candleWidth 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 double of variable that.candleWidth does not match with type org.jfree.ui.HorizontalAlignment of variable that.textAlignment
    12
    if (this.textAlignment != that.textAlignment)
    7
    return false;
    13
    return false;
    8
    if (!PaintUtilities.equal(this.upPaint, that.upPaint))
    8
    if (!PaintUtilities.equal(this.upPaint, that.upPaint))
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    Differences
    Expression1Expression2Difference
    upPaintpaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    upPaintpaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.upPaint 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
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    9
    return false;
    11
    return false;
    10
    if (!PaintUtilities.equal(this.downPaint, that.downPaint))
    10
    if (!PaintUtilities.equal(this.downPaint, that.downPaint))
    14
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    Differences
    Expression1Expression2Difference
    downPaintbackgroundPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    downPaintbackgroundPaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.downPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    11
    return false;
    15
    return false;
    12
    if (this.drawVolume != that.drawVolume)
    12
    if (this.drawVolume != that.drawVolume)
    18
    if (this.expandToFitSpace != that.expandToFitSpace)
    Differences
    Expression1Expression2Difference
    drawVolumeexpandToFitSpaceVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    drawVolumeexpandToFitSpaceVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.drawVolume 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)
    13
    return false;
    19
    return false;
    14
    if (this.maxCandleWidthInMilliseconds != that.maxCandleWidthInMilliseconds)
    14
    if (this.maxCandleWidthInMilliseconds != that.maxCandleWidthInMilliseconds)
    16
    if (this.maximumLinesToDisplay != that.maximumLinesToDisplay)
    Differences
    Expression1Expression2Difference
    maxCandleWidthInMillisecondsmaximumLinesToDisplayVARIABLE_NAME_MISMATCH
    doubleintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    maxCandleWidthInMillisecondsmaximumLinesToDisplayVARIABLE_NAME_MISMATCH
    doubleintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.maxCandleWidthInMilliseconds does not match with type int of variable this.maximumLinesToDisplay
    Expression that.maxCandleWidthInMilliseconds 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 double of variable that.maxCandleWidthInMilliseconds does not match with type int of variable that.maximumLinesToDisplay
    16
    if (this.maximumLinesToDisplay != that.maximumLinesToDisplay)
    15
    return false;
    17
    return false;
    16
    if (this.autoWidthMethod != that.autoWidthMethod)
    16
    if (this.autoWidthMethod != that.autoWidthMethod)
    Preondition Violations
    Unmatched statement if(this.autoWidthMethod != that.autoWidthMethod) 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 (this.autoWidthFactor != that.autoWidthFactor)
    18
    if (this.autoWidthFactor != that.autoWidthFactor)
    Preondition Violations
    Unmatched statement if(this.autoWidthFactor != that.autoWidthFactor) 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.autoWidthGap != that.autoWidthGap)
    20
    if (this.autoWidthGap != that.autoWidthGap)
    Preondition Violations
    Unmatched statement if(this.autoWidthGap != that.autoWidthGap) 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 (this.useOutlinePaint != that.useOutlinePaint)
    22
    if (this.useOutlinePaint != that.useOutlinePaint)
    Preondition Violations
    Unmatched statement if(this.useOutlinePaint != that.useOutlinePaint) 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 (!PaintUtilities.equal(this.volumePaint, that.volumePaint))
    24
    if (!PaintUtilities.equal(this.volumePaint, that.volumePaint))
    8
    if (!ObjectUtilities.equal(this.font, that.font))
    Differences
    Expression1Expression2Difference
    volumePaintfontVARIABLE_NAME_MISMATCH
    java.awt.Paintjava.awt.FontVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.title.TextTitleSUBCLASS_TYPE_MISMATCH
    volumePaintfontVARIABLE_NAME_MISMATCH
    java.awt.Paintjava.awt.FontVARIABLE_TYPE_MISMATCH
    org.jfree.util.PaintUtilitiesorg.jfree.util.ObjectUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Paint of variable this.volumePaint does not match with type java.awt.Font of variable this.font
    • Make classes java.awt.Paint and java.awt.Font extend a common superclass
    Expression that.volumePaint 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.awt.Paint of variable that.volumePaint does not match with type java.awt.Font of variable that.font
    • Make classes java.awt.Paint and java.awt.Font 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.font, that.font))
    25
    return false;
    9
    return false;
    Precondition Violations (32)
    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;
    3Type double of variable this.candleWidth does not match with type org.jfree.ui.HorizontalAlignment of variable this.textAlignment
    4Expression that.candleWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.textAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type double of variable that.candleWidth does not match with type org.jfree.ui.HorizontalAlignment of variable that.textAlignment
    7Expression that.upPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.downPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.drawVolume cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.expandToFitSpace cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Type double of variable this.maxCandleWidthInMilliseconds does not match with type int of variable this.maximumLinesToDisplay
    14Expression that.maxCandleWidthInMilliseconds cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.maximumLinesToDisplay cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type double of variable that.maxCandleWidthInMilliseconds does not match with type int of variable that.maximumLinesToDisplay
    17Unmatched statement if(this.autoWidthMethod != that.autoWidthMethod) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    18Unmatched return false;
    19Unmatched statement if(this.autoWidthFactor != that.autoWidthFactor) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    20Unmatched return false;
    21Unmatched statement if(this.autoWidthGap != that.autoWidthGap) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    22Unmatched return false;
    23Unmatched statement if(this.useOutlinePaint != that.useOutlinePaint) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    24Unmatched return false;
    25Type java.awt.Paint of variable this.volumePaint does not match with type java.awt.Font of variable this.font
    26Expression that.volumePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    27Expression that.font cannot be parameterized, because it has dependencies to/from statements that will be extracted
    28Type java.awt.Paint of variable that.volumePaint does not match with type java.awt.Font of variable that.font
    29Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities
    30Clone fragment #1 returns variable that with type org.jfree.chart.renderer.xy.CandlestickRenderer , while Clone fragment #2 returns variable that with type org.jfree.chart.title.TextTitle
    31Not all possible execution flows end in a return statement
    32The refactoring of the clones is infeasible, because classes org.jfree.chart.renderer.xy.CandlestickRenderer and org.jfree.chart.title.TextTitle do not have a common superclass