if (obj == this) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof WaterfallBarRenderer)) { return false; } WaterfallBarRenderer that = (WaterfallBarRenderer) obj; if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint)) { return false; } if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint)) { return false; } if (!PaintUtilities.equal(this.positiveBarPaint, that.positiveBarPaint)) { return false; } if (!PaintUtilities.equal(this.negativeBarPaint, that.negativeBarPaint)) { return false; } return true;
if (this == obj) { return true; } if (!(obj instanceof HighLowRenderer)) { return false; } HighLowRenderer that = (HighLowRenderer) obj; if (this.drawOpenTicks != that.drawOpenTicks) { return false; } if (this.drawCloseTicks != that.drawCloseTicks) { return false; } if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint)) { return false; } if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint)) { return false; } if (this.tickLength != that.tickLength) { return false; } if (!super.equals(obj)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/WaterfallBarRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/HighLowRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 16 Number of AST nodes: 18
1
if (obj == this) {
1
if (this == obj) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!super.equals(obj)) {
4
        if (!(obj instanceof HighLowRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!(obj instanceof WaterfallBarRenderer)) {
7
        
8
            return false;
9
        }
10
        WaterfallBarRenderer that = (WaterfallBarRenderer) obj;
8
HighLowRenderer that = (HighLowRenderer) obj;
9
        if (this.drawOpenTicks != that.drawOpenTicks) {
10
            return false;
11
        }
12
        if (this.drawCloseTicks != that.drawCloseTicks) {
13
            return false;
14
        }
11
        if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint)) {
15
        if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint)) {
12
            return false;
16
            return false;
13
        }
17
        }
14
        if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint)) {
18
        if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint)) {
15
            return false;
19
            return false;
16
        }
20
        }
17
        if (!PaintUtilities.equal(this.positiveBarPaint,
21
        if (
18
                that.positiveBarPaint)) {
22
this.tickLength != that.tickLength) {
19
            return false;
23
            return false;
20
        }
24
        }
21
        if (!PaintUtilities.equal(this.negativeBarPaint,
25
        if (!
22
                that.negativeBarPaint)) {
26
super.equals(obj)) {
23
            return false;
27
            return false;
24
        }
28
        }
25
        return true;
29
        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)5.5
Clones locationClones are in different classes having the same super class
Number of node comparisons87
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment6
    Time elapsed for statement mapping (ms)6.2
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    if (!super.equals(obj))
    3
    if (!super.equals(obj))
    16
    if (!super.equals(obj))
    Preondition Violations
    Super method call if(!super.equals(obj)) cannot be extracted from method
    Super method call if(!super.equals(obj)) cannot be extracted from method
    16
    if (!super.equals(obj))
    4
    return false;
    17
    return false;
    5
    if (!(obj instanceof WaterfallBarRenderer))
    5
    if (!(obj instanceof WaterfallBarRenderer))
    3
    if (!(obj instanceof HighLowRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.category.WaterfallBarRendererorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof HighLowRenderer))
    6
    return false;
    4
    return false;
    7
    WaterfallBarRenderer that = (WaterfallBarRenderer)obj;
    7
    WaterfallBarRenderer that = (WaterfallBarRenderer)obj;
    5
    HighLowRenderer that = (HighLowRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.category.WaterfallBarRendererorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.renderer.category.WaterfallBarRendererorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.renderer.category.WaterfallBarRendererorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    5
    HighLowRenderer that = (HighLowRenderer)obj;
                                                                                                  
    6
    if (this.drawOpenTicks != that.drawOpenTicks)
    Preondition Violations
    Unmatched statement if(this.drawOpenTicks != that.drawOpenTicks) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    if (this.drawOpenTicks != that.drawOpenTicks)
                                    
    7
    return false;
    Preondition Violations
    Unmatched return false;
    7
    return false;
                                                                                                      
    8
    if (this.drawCloseTicks != that.drawCloseTicks)
    Preondition Violations
    Unmatched statement if(this.drawCloseTicks != that.drawCloseTicks) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    if (this.drawCloseTicks != that.drawCloseTicks)
                                    
    9
    return false;
    Preondition Violations
    Unmatched return false;
    9
    return false;
    8
    if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint))
    8
    if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint))
    10
    if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint))
    Differences
    Expression1Expression2Difference
    firstBarPaintopenTickPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.category.WaterfallBarRendererorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    firstBarPaintopenTickPaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.firstBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.openTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint))
    9
    return false;
    11
    return false;
    10
    if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint))
    10
    if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint))
    12
    if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint))
    Differences
    Expression1Expression2Difference
    lastBarPaintcloseTickPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.category.WaterfallBarRendererorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    lastBarPaintcloseTickPaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.lastBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.closeTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint))
    11
    return false;
    13
    return false;
                                                                                        
    14
    if (this.tickLength != that.tickLength)
    Preondition Violations
    Unmatched statement if(this.tickLength != that.tickLength) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    14
    if (this.tickLength != that.tickLength)
                                      
    15
    return false;
    Preondition Violations
    Unmatched return false;
    15
    return false;
    Precondition Violations (14)
    Row Violation
    1Super method call if(!super.equals(obj)) cannot be extracted from method
    2Super method call if(!super.equals(obj)) cannot be extracted from method
    3Unmatched statement if(this.drawOpenTicks != that.drawOpenTicks) 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(this.drawCloseTicks != that.drawCloseTicks) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched return false;
    7Expression that.firstBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.openTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.lastBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.closeTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Unmatched statement if(this.tickLength != that.tickLength) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    12Unmatched return false;
    13Clone fragment #1 returns variable that with type org.jfree.chart.renderer.category.WaterfallBarRenderer , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.xy.HighLowRenderer
    14Not all possible execution flows end in a return statement