if (obj == this) { return true; } if (!(obj instanceof CategoryAxis)) { return false; } if (!super.equals(obj)) { return false; } CategoryAxis that = (CategoryAxis) obj; if (that.lowerMargin != this.lowerMargin) { return false; } if (that.upperMargin != this.upperMargin) { return false; } if (that.categoryMargin != this.categoryMargin) { return false; } if (that.maximumCategoryLabelWidthRatio != this.maximumCategoryLabelWidthRatio) { return false; } if (that.categoryLabelPositionOffset != this.categoryLabelPositionOffset) { return false; } if (!ObjectUtilities.equal(that.categoryLabelPositions, this.categoryLabelPositions)) { return false; } if (!ObjectUtilities.equal(that.categoryLabelToolTips, this.categoryLabelToolTips)) { return false; } if (!ObjectUtilities.equal(this.tickLabelFontMap, that.tickLabelFontMap)) { return false; } if (!equalPaintMaps(this.tickLabelPaintMap, that.tickLabelPaintMap)) { return false; } return true;
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);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryAxis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/CandlestickRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 26 Number of AST nodes: 26
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof CategoryAxis)) {
4
        if (!(obj instanceof CandlestickRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!super.equals(obj)) {
7
        
8
            return false;
9
        }
10
        CategoryAxis that = (CategoryAxis) obj;
11
        if (that.lowerMargin != this.lowerMargin
8
CandlestickRenderer that = (CandlestickRenderer) obj;
9
        if (this.candleWidth != that.candleWidth) {
10
            return false;
11
        }
12
) {
12
        if (!PaintUtilities.equal(this.upPaint, that.upPaint)) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (that.upperMargin != this.upperMargin) {
15
        if (!PaintUtilities.equal(this.downPaint, that.downPaint)) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (that.categoryMargin != this.categoryMargin) {
18
        if (this.drawVolume != that.drawVolume) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (that.maximumCategoryLabelWidthRatio
21
        if (this.maxCandleWidthInMilliseconds
22
                != this.maximumCategoryLabelWidthRatio) {
22
                != that.maxCandleWidthInMilliseconds) {
23
            return false;
23
            return false;
24
        }
24
        }
25
        if (that.categoryLabelPositionOffset
25
        if (th
26
                != this.categoryLabelPositionOffset) {
26
is.autoWidthMethod != that.autoWidthMethod) {
27
            return false;
27
            return false;
28
        }
28
        }
29
        if (!ObjectUtilities.equal(that.categoryLabelPositions,
29
        if (
30
                this.categoryLabelPositions)) {
30
this.autoWidthFactor != that.autoWidthFactor) {
31
            return false;
31
            return false;
32
        }
32
        }
33
        if (!ObjectUtilities.equal(that.categoryLabelToolTips,
33
        if (
34
                this.categoryLabelToolTips)) {
35
            return false;
36
        }
37
        if (!ObjectUtilities.equal(this.tickLabelFontMap,
38
                that.tickLabelFontMap)
34
this.autoWidthGap != that.autoWidthGap) {
35
            return false;
36
        }
39
) {
37
        if (this.useOutlinePaint != that.useOutlinePaint) {
40
            return false;
38
            return false;
41
        }
39
        }
42
        if (!equalPaintMaps(this.tickLabelPaintMap, that.tickLabelPaintMap)) {
40
        if (!PaintUtilities.equal(this.volumePaint, that.volumePaint)) {
43
            return false;
41
            return false;
44
        }
42
        }
45
        return true;
43
        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)9.1
Clones locationClones are in different classes
Number of node comparisons208
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements18
    Number of unmapped statements in the first code fragment7
    Number of unmapped statements in the second code fragment7
    Time elapsed for statement mapping (ms)10.8
    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 CategoryAxis))
    3
    if (!(obj instanceof CategoryAxis))
    3
    if (!(obj instanceof CandlestickRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.renderer.xy.CandlestickRendererVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.CategoryAxis does not match with type org.jfree.chart.renderer.xy.CandlestickRenderer
    • Make classes org.jfree.chart.axis.CategoryAxis and org.jfree.chart.renderer.xy.CandlestickRenderer extend a common superclass
    3
    if (!(obj instanceof CandlestickRenderer))
    4
    return false;
    4
    return false;
                                                                                                              
    5
    CandlestickRenderer that = (CandlestickRenderer)obj;
    5
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    8
    if (!PaintUtilities.equal(this.upPaint, that.upPaint))
    Differences
    Expression1Expression2Difference
    super.equals(obj)PaintUtilities.equal(this.upPaint,that.upPaint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression PaintUtilities.equal(this.upPaint,that.upPaint) 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
    8
    if (!PaintUtilities.equal(this.upPaint, that.upPaint))
    6
    return false;
    9
    return false;
    7
    CategoryAxis that = (CategoryAxis)obj;
                                                                                  
    8
    if (that.lowerMargin != this.lowerMargin)
    8
    if (that.lowerMargin != this.lowerMargin)
    6
    if (this.candleWidth != that.candleWidth)
    Differences
    Expression1Expression2Difference
    that.lowerMarginthis.candleWidthTYPE_COMPATIBLE_REPLACEMENT
    this.lowerMarginthat.candleWidthTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression that.lowerMargin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.candleWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (this.candleWidth != that.candleWidth)
    9
    return false;
    7
    return false;
                                                                                        
    12
    if (this.drawVolume != that.drawVolume)
                                      
    13
    return false;
    Preondition Violations
    Unmatched return false;
    13
    return false;
    10
    if (that.upperMargin != this.upperMargin)
    10
    if (that.upperMargin != this.upperMargin)
    14
    if (this.maxCandleWidthInMilliseconds != that.maxCandleWidthInMilliseconds)
    Differences
    Expression1Expression2Difference
    that.upperMarginthis.maxCandleWidthInMillisecondsTYPE_COMPATIBLE_REPLACEMENT
    this.upperMarginthat.maxCandleWidthInMillisecondsTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression that.upperMargin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.maxCandleWidthInMilliseconds cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (this.maxCandleWidthInMilliseconds != that.maxCandleWidthInMilliseconds)
    11
    return false;
    15
    return false;
    12
    if (that.categoryMargin != this.categoryMargin)
    12
    if (that.categoryMargin != this.categoryMargin)
    18
    if (this.autoWidthFactor != that.autoWidthFactor)
    Differences
    Expression1Expression2Difference
    that.categoryMarginthis.autoWidthFactorTYPE_COMPATIBLE_REPLACEMENT
    this.categoryMarginthat.autoWidthFactorTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression that.categoryMargin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.autoWidthFactor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18
    if (this.autoWidthFactor != that.autoWidthFactor)
    13
    return false;
    19
    return false;
    14
    if (that.maximumCategoryLabelWidthRatio != this.maximumCategoryLabelWidthRatio)
                                                                                                                                                                        
    15
    return false;
    15
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    16
    if (that.categoryLabelPositionOffset != this.categoryLabelPositionOffset)
    16
    if (that.categoryLabelPositionOffset != this.categoryLabelPositionOffset)
    16
    if (this.autoWidthMethod != that.autoWidthMethod)
    Differences
    Expression1Expression2Difference
    that.categoryLabelPositionOffsetthis.autoWidthMethodTYPE_COMPATIBLE_REPLACEMENT
    this.categoryLabelPositionOffsetthat.autoWidthMethodTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression that.categoryLabelPositionOffset cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.autoWidthMethod cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    if (this.autoWidthMethod != that.autoWidthMethod)
    17
    return false;
    17
    return false;
    18
    if (!ObjectUtilities.equal(that.categoryLabelPositions, this.categoryLabelPositions))
                                                                                                                                                                                  
    19
    return false;
    19
    return false;
    Preondition Violations
    Unmatched return false;
                                      
                                                                                                
    20
    if (this.autoWidthGap != that.autoWidthGap)
                                      
    21
    return false;
    Preondition Violations
    Unmatched return false;
    21
    return false;
    20
    if (!ObjectUtilities.equal(that.categoryLabelToolTips, this.categoryLabelToolTips))
                                                                                                                                                                              
    21
    return false;
    21
    return false;
    Preondition Violations
    Unmatched return false;
                                      
                                                                                                            
    22
    if (this.useOutlinePaint != that.useOutlinePaint)
                                      
    23
    return false;
    Preondition Violations
    Unmatched return false;
    23
    return false;
    22
    if (!ObjectUtilities.equal(this.tickLabelFontMap, that.tickLabelFontMap))
    22
    if (!ObjectUtilities.equal(this.tickLabelFontMap, that.tickLabelFontMap))
    24
    if (!PaintUtilities.equal(this.volumePaint, that.volumePaint))
    Differences
    Expression1Expression2Difference
    tickLabelFontMapvolumePaintVARIABLE_NAME_MISMATCH
    java.util.Mapjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.renderer.xy.CandlestickRendererVARIABLE_TYPE_MISMATCH
    tickLabelFontMapvolumePaintVARIABLE_NAME_MISMATCH
    java.util.Mapjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Map of variable this.tickLabelFontMap does not match with type java.awt.Paint of variable this.volumePaint
    • Make classes java.util.Map and java.awt.Paint extend a common superclass
    Type java.util.Map of variable that.tickLabelFontMap does not match with type java.awt.Paint of variable that.volumePaint
    • Make classes org.jfree.chart.axis.CategoryAxis and org.jfree.chart.renderer.xy.CandlestickRenderer extend a common superclass
    Expression that.tickLabelFontMap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.volumePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.util.Map of variable that.tickLabelFontMap does not match with type java.awt.Paint of variable that.volumePaint
    • Make classes java.util.Map 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
    24
    if (!PaintUtilities.equal(this.volumePaint, that.volumePaint))
    23
    return false;
    25
    return false;
    24
    if (!equalPaintMaps(this.tickLabelPaintMap, that.tickLabelPaintMap))
    24
    if (!equalPaintMaps(this.tickLabelPaintMap, that.tickLabelPaintMap))
    10
    if (!PaintUtilities.equal(this.downPaint, that.downPaint))
    Differences
    Expression1Expression2Difference
    equalPaintMaps(this.tickLabelPaintMap,that.tickLabelPaintMap)PaintUtilities.equal(this.downPaint,that.downPaint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression equalPaintMaps(this.tickLabelPaintMap,that.tickLabelPaintMap) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method equalPaintMaps
    Expression PaintUtilities.equal(this.downPaint,that.downPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (!PaintUtilities.equal(this.downPaint, that.downPaint))
    25
    return false;
    11
    return false;
    Precondition Violations (27)
    Row Violation
    1Type org.jfree.chart.axis.CategoryAxis does not match with type org.jfree.chart.renderer.xy.CandlestickRenderer
    2Expression PaintUtilities.equal(this.upPaint,that.upPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Super method call if(!super.equals(obj)) cannot be extracted from method
    4Expression that.lowerMargin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.candleWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Unmatched return false;
    7Expression that.upperMargin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.maxCandleWidthInMilliseconds cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.categoryMargin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.autoWidthFactor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Unmatched return false;
    12Expression that.categoryLabelPositionOffset cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression that.autoWidthMethod cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Unmatched return false;
    15Unmatched return false;
    16Unmatched return false;
    17Unmatched return false;
    18Type java.util.Map of variable this.tickLabelFontMap does not match with type java.awt.Paint of variable this.volumePaint
    19Type java.util.Map of variable that.tickLabelFontMap does not match with type java.awt.Paint of variable that.volumePaint
    20Expression that.tickLabelFontMap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression that.volumePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Type java.util.Map of variable that.tickLabelFontMap does not match with type java.awt.Paint of variable that.volumePaint
    23Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    24Expression equalPaintMaps(this.tickLabelPaintMap,that.tickLabelPaintMap) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Expression PaintUtilities.equal(this.downPaint,that.downPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    26Not all possible execution flows end in a return statement
    27The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.CategoryAxis and org.jfree.chart.renderer.xy.CandlestickRenderer do not have a common superclass