if (obj == this) { return true; } if (!(obj instanceof DateAxis)) { return false; } DateAxis that = (DateAxis) obj; if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) { return false; } if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride)) { return false; } if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition)) { return false; } if (!ObjectUtilities.equal(this.timeline, that.timeline)) { return false; } if (!super.equals(obj)) { 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/axis/DateAxis.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 (!(obj instanceof DateAxis)) {
4
        if (!(obj instanceof HighLowRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        DateAxis that = (DateAxis) obj;
7
        
8
        if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)
8
HighLowRenderer that = (HighLowRenderer) obj;
9
        if (this.drawOpenTicks != that.drawOpenTicks) {
10
            return false;
11
        }
9
) {
12
        if (this.drawCloseTicks != that.drawCloseTicks) {
10
            return false;
13
            return false;
11
        }
14
        }
12
        if (!ObjectUtilities.equal(this.dateFormatOverride,
15
        if (!PaintUtilities.equal(this.
13
                that.dateFormatOverride)) {
16
openTickPaint, that.openTickPaint)) {
14
            return false;
17
            return false;
15
        }
18
        }
16
        if (!ObjectUtilities.equal(this.tickMarkPosition,
19
        if (!PaintUtilities.equal(this.
17
                that.tickMarkPosition)) {
20
closeTickPaint, that.closeTickPaint)) {
18
            return false;
21
            return false;
19
        }
22
        }
20
        if (!ObjectUtilities.equal(this.timeline, that.timeline)) {
23
        if (this.tickLength != that.tickLength) {
21
            return false;
24
            return false;
22
        }
25
        }
23
        if (!super.equals(obj)) {
26
        if (!super.equals(obj)) {
24
            return false;
27
            return false;
25
        }
28
        }
26
        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)4.7
Clones locationClones are in different classes
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)5.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    if (!(obj instanceof DateAxis))
    3
    if (!(obj instanceof DateAxis))
    3
    if (!(obj instanceof HighLowRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.DateAxisorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof HighLowRenderer))
    4
    return false;
    4
    return false;
    5
    DateAxis that = (DateAxis)obj;
    5
    DateAxis that = (DateAxis)obj;
    5
    HighLowRenderer that = (HighLowRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.DateAxisorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.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;
    6
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    6
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    10
    if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint))
    Differences
    Expression1Expression2Difference
    tickUnitopenTickPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.DateTickUnitjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    tickUnitopenTickPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.DateTickUnitjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.DateTickUnit of variable this.tickUnit does not match with type java.awt.Paint of variable this.openTickPaint
    • Make classes org.jfree.chart.axis.DateTickUnit and java.awt.Paint extend a common superclass
    Expression that.tickUnit 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
    Type org.jfree.chart.axis.DateTickUnit of variable that.tickUnit does not match with type java.awt.Paint of variable that.openTickPaint
    • Make classes org.jfree.chart.axis.DateTickUnit and java.awt.Paint extend a common superclass
    Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    • Make classes org.jfree.util.ObjectUtilities and org.jfree.util.PaintUtilities extend a common superclass
    10
    if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint))
    7
    return false;
    11
    return false;
    8
    if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride))
    8
    if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride))
    12
    if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint))
    Differences
    Expression1Expression2Difference
    dateFormatOverridecloseTickPaintVARIABLE_NAME_MISMATCH
    java.text.DateFormatjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    dateFormatOverridecloseTickPaintVARIABLE_NAME_MISMATCH
    java.text.DateFormatjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.text.DateFormat of variable this.dateFormatOverride does not match with type java.awt.Paint of variable this.closeTickPaint
    • Make classes java.text.DateFormat and java.awt.Paint extend a common superclass
    Expression that.dateFormatOverride 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
    Type java.text.DateFormat of variable that.dateFormatOverride does not match with type java.awt.Paint of variable that.closeTickPaint
    • Make classes java.text.DateFormat and java.awt.Paint extend a common superclass
    Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    • Make classes org.jfree.util.ObjectUtilities and org.jfree.util.PaintUtilities extend a common superclass
    12
    if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint))
    9
    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;
    10
    if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition))
    10
    if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition))
    16
    if (!super.equals(obj))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.tickMarkPosition,that.tickMarkPosition)super.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.tickMarkPosition,that.tickMarkPosition) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Super method call if(!super.equals(obj)) cannot be extracted from method
    16
    if (!super.equals(obj))
    11
    return false;
    17
    return false;
    Precondition Violations (20)
    Row Violation
    1Unmatched 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
    2Unmatched return false;
    3Unmatched 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
    4Unmatched return false;
    5Type org.jfree.chart.axis.DateTickUnit of variable this.tickUnit does not match with type java.awt.Paint of variable this.openTickPaint
    6Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.openTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type org.jfree.chart.axis.DateTickUnit of variable that.tickUnit does not match with type java.awt.Paint of variable that.openTickPaint
    9Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    10Type java.text.DateFormat of variable this.dateFormatOverride does not match with type java.awt.Paint of variable this.closeTickPaint
    11Expression that.dateFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.closeTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Type java.text.DateFormat of variable that.dateFormatOverride does not match with type java.awt.Paint of variable that.closeTickPaint
    14Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    15Unmatched 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
    16Unmatched return false;
    17Expression ObjectUtilities.equal(this.tickMarkPosition,that.tickMarkPosition) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Super method call if(!super.equals(obj)) cannot be extracted from method
    19Clone fragment #1 returns variable that with type org.jfree.chart.axis.DateAxis , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.xy.HighLowRenderer
    20Not all possible execution flows end in a return statement