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 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);
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/StandardXYItemRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 26 Number of AST nodes: 28
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 StandardXYItemRenderer)) {
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
StandardXYItemRenderer that = (StandardXYItemRenderer) obj;
9
        if (this.baseShapesVisible != that.baseShapesVisible) {
10
            return false;
11
        }
12
) {
12
        if (this.plotLines != that.plotLines) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (that.upperMargin != this.upperMargin) {
15
        if (this.plotImages != that.plotImages) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (that.categoryMargin != this.categoryMargin) {
18
        if (this.plotDiscontinuous != that.plotDiscontinuous) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (that.maximumCategoryLabelWidthRatio
21
        if (th
22
                != this.maximumCategoryLabelWidthRatio) {
22
is.gapThresholdType != that.gapThresholdType) {
23
            return false;
23
            return false;
24
        }
24
        }
25
        if (that.categoryLabelPositionOffset
25
        if (th
26
                != this.categoryLabelPositionOffset) {
26
is.gapThreshold != that.gapThreshold) {
27
            return false;
27
            return false;
28
        }
28
        }
29
        if (!ObjectUtilities.equal(that.categoryLabelPositions,
29
        if (!ObjectUtilities.equal(th
30
                this.categoryLabelPositions)) {
30
is.shapesFilled, that.shapesFilled)) {
31
            return false;
31
            return false;
32
        }
32
        }
33
        if (!ObjectUtilities.equal(that.categoryLabelToolTips,
33
        if (!this.seriesShapesFilled.equals(that.seriesShapesFilled)) {
34
            return false;
34
        
35
        }
35
        this.categoryLabelToolTips)) {
36
        if (this.baseShapesFilled != that.baseShapesFilled) {
36
            return false;
37
            return false;
37
        }
38
        }
38
        if (!ObjectUtilities.equal(this.tickLabelFontMap,
39
        if (
39
                that.tickLabelFontMap)) {
40
this.drawSeriesLineAsPath != that.drawSeriesLineAsPath) {
40
            return false;
41
            return false;
41
        }
42
        }
42
        if (!equalPaintMaps(this.tickLabelPaintMap, that.tickLabelPaintMap)) {
43
        if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) {
43
            return false;
44
            return false;
44
        }
45
        }
45
        return true;
46
        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)10.3
Clones locationClones are in different classes
Number of node comparisons190
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment13
    Number of unmapped statements in the second code fragment17
    Time elapsed for statement mapping (ms)8.2
    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 StandardXYItemRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.renderer.xy.StandardXYItemRendererVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.CategoryAxis does not match with type org.jfree.chart.renderer.xy.StandardXYItemRenderer
    • Make classes org.jfree.chart.axis.CategoryAxis and org.jfree.chart.renderer.xy.StandardXYItemRenderer extend a common superclass
    3
    if (!(obj instanceof StandardXYItemRenderer))
    4
    return false;
    4
    return false;
                                                                                                                          
    5
    StandardXYItemRenderer that = (StandardXYItemRenderer)obj;
                                                                                                                  
    6
    if (this.baseShapesVisible != that.baseShapesVisible)
                                    
    7
    return false;
    Preondition Violations
    Unmatched return false;
    7
    return false;
                                                                                  
    8
    if (this.plotLines != that.plotLines)
                                    
    9
    return false;
    Preondition Violations
    Unmatched return false;
    9
    return false;
                                                                                        
    10
    if (this.plotImages != that.plotImages)
                                      
    11
    return false;
    Preondition Violations
    Unmatched return false;
    11
    return false;
                                                                                                                    
    12
    if (this.plotDiscontinuous != that.plotDiscontinuous)
                                      
    13
    return false;
    Preondition Violations
    Unmatched return false;
    13
    return false;
                                                                                                                
    14
    if (this.gapThresholdType != that.gapThresholdType)
                                      
    15
    return false;
    Preondition Violations
    Unmatched return false;
    15
    return false;
    5
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    20
    if (!this.seriesShapesFilled.equals(that.seriesShapesFilled))
    Differences
    Expression1Expression2Difference
    super.equals(obj)this.seriesShapesFilled.equals(that.seriesShapesFilled)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
    Super method call if(!super.equals(obj)) cannot be extracted from method
    20
    if (!this.seriesShapesFilled.equals(that.seriesShapesFilled))
    6
    return false;
    21
    return false;
    7
    CategoryAxis that = (CategoryAxis)obj;
                                                                                  
    8
    if (that.lowerMargin != this.lowerMargin)
    8
    if (that.lowerMargin != this.lowerMargin)
    16
    if (this.gapThreshold != that.gapThreshold)
    Differences
    Expression1Expression2Difference
    that.lowerMarginthis.gapThresholdTYPE_COMPATIBLE_REPLACEMENT
    this.lowerMarginthat.gapThresholdTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression that.lowerMargin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.gapThreshold cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    if (this.gapThreshold != that.gapThreshold)
    9
    return false;
    17
    return false;
    10
    if (that.upperMargin != this.upperMargin)
                                                                                            
    11
    return false;
    11
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    12
    if (that.categoryMargin != this.categoryMargin)
                                                                                                        
    13
    return false;
    13
    return false;
    Preondition Violations
    Unmatched 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)
                                                                                                                                                            
    17
    return false;
    17
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    18
    if (!ObjectUtilities.equal(that.categoryLabelPositions, this.categoryLabelPositions))
                                                                                                                                                                                  
    19
    return false;
    19
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    20
    if (!ObjectUtilities.equal(that.categoryLabelToolTips, this.categoryLabelToolTips))
                                                                                                                                                                              
    21
    return false;
    21
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    22
    if (!ObjectUtilities.equal(this.tickLabelFontMap, that.tickLabelFontMap))
    22
    if (!ObjectUtilities.equal(this.tickLabelFontMap, that.tickLabelFontMap))
    18
    if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled))
    Differences
    Expression1Expression2Difference
    tickLabelFontMapshapesFilledVARIABLE_NAME_MISMATCH
    java.util.Mapjava.lang.BooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.renderer.xy.StandardXYItemRendererVARIABLE_TYPE_MISMATCH
    tickLabelFontMapshapesFilledVARIABLE_NAME_MISMATCH
    java.util.Mapjava.lang.BooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Map of variable this.tickLabelFontMap does not match with type java.lang.Boolean of variable this.shapesFilled
    • Make classes java.util.Map and java.lang.Boolean extend a common superclass
    Type java.util.Map of variable that.tickLabelFontMap does not match with type java.lang.Boolean of variable that.shapesFilled
    • Make classes org.jfree.chart.axis.CategoryAxis and org.jfree.chart.renderer.xy.StandardXYItemRenderer extend a common superclass
    Expression that.tickLabelFontMap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.shapesFilled 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.lang.Boolean of variable that.shapesFilled
    • Make classes java.util.Map and java.lang.Boolean extend a common superclass
    18
    if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled))
    23
    return false;
    19
    return false;
                                                                                                                
    22
    if (this.baseShapesFilled != that.baseShapesFilled)
                                      
    23
    return false;
    Preondition Violations
    Unmatched return false;
    23
    return false;
                                                                                                                                
    24
    if (this.drawSeriesLineAsPath != that.drawSeriesLineAsPath)
                                      
    25
    return false;
    Preondition Violations
    Unmatched return false;
    25
    return false;
                                                                                                                                
    26
    if (!ShapeUtilities.equal(this.legendLine, that.legendLine))
                                      
    27
    return false;
    Preondition Violations
    Unmatched return false;
    27
    return false;
    Precondition Violations (26)
    Row Violation
    1Type org.jfree.chart.axis.CategoryAxis does not match with type org.jfree.chart.renderer.xy.StandardXYItemRenderer
    2Unmatched return false;
    3Unmatched return false;
    4Unmatched return false;
    5Unmatched return false;
    6Unmatched return false;
    7Expression this.seriesShapesFilled.equals(that.seriesShapesFilled) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Super method call if(!super.equals(obj)) cannot be extracted from method
    9Expression that.lowerMargin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.gapThreshold cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Unmatched return false;
    12Unmatched return false;
    13Unmatched return false;
    14Unmatched return false;
    15Unmatched return false;
    16Unmatched return false;
    17Type java.util.Map of variable this.tickLabelFontMap does not match with type java.lang.Boolean of variable this.shapesFilled
    18Type java.util.Map of variable that.tickLabelFontMap does not match with type java.lang.Boolean of variable that.shapesFilled
    19Expression that.tickLabelFontMap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression that.shapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Type java.util.Map of variable that.tickLabelFontMap does not match with type java.lang.Boolean of variable that.shapesFilled
    22Unmatched return false;
    23Unmatched return false;
    24Unmatched return false;
    25Not all possible execution flows end in a return statement
    26The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.CategoryAxis and org.jfree.chart.renderer.xy.StandardXYItemRenderer do not have a common superclass