if (obj == this) { return true; } if (!(obj instanceof XYTitleAnnotation)) { return false; } XYTitleAnnotation that = (XYTitleAnnotation) obj; if (this.coordinateType != that.coordinateType) { return false; } if (this.x != that.x) { return false; } if (this.y != that.y) { return false; } if (this.maxWidth != that.maxWidth) { return false; } if (this.maxHeight != that.maxHeight) { return false; } if (!ObjectUtilities.equal(this.title, that.title)) { return false; } if (!this.anchor.equals(that.anchor)) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof CyclicNumberAxis)) { return false; } if (!super.equals(obj)) { return false; } CyclicNumberAxis that = (CyclicNumberAxis) obj; if (this.period != that.period) { return false; } if (this.offset != that.offset) { return false; } if (!PaintUtilities.equal(this.advanceLinePaint, that.advanceLinePaint)) { return false; } if (!ObjectUtilities.equal(this.advanceLineStroke, that.advanceLineStroke)) { return false; } if (this.advanceLineVisible != that.advanceLineVisible) { return false; } if (this.boundMappedToLastCycle != that.boundMappedToLastCycle) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/experimental/org/jfree/experimental/chart/annotations/XYTitleAnnotation.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CyclicNumberAxis.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 20 Number of AST nodes: 20
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof XYTitleAnnotation)) {
4
        if (!(obj instanceof CyclicNumberAxis)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        XYTitleAnnotation that = (XYTitleAnnotation) obj;
7
        
8
        if (this.coordinateType != that.coordinateType) {
9
            return false;
10
  
8
if (!super.equals(obj)) {
9
            return false;
10
        }
11
      }
11
        CyclicNumberAxis that = (CyclicNumberAxis) obj;      
12
        if (this.x != that.x) {
12
        if (this.period != that.period) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (this.y != that.y) {
15
        if (this.offset != that.offset) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (this.maxWidth != that.maxWidth
18
        if (!PaintUtilities.equal(this.advanceLinePaint, 
19
) {
19
                that.advanceLinePaint)) {
20
            return false;
20
            return false;
21
        }
21
        }
22
        if (this.maxHeight != that.maxHeight
22
        if (!ObjectUtilities.equal(this.advanceLineStroke, 
23
) {
23
                that.advanceLineStroke)) {
24
            return false;
24
            return false;
25
        }
25
        }
26
        if (!ObjectUtilities.equal(this.title, that.title)) {
26
        if (this.advanceLineVisible != that.advanceLineVisible) {
27
            return false;
27
            return false;
28
        }
28
        }
29
        if (!this.anchor.equals(that.anchor)) {
29
        if (this.boundMappedToLastCycle != that.boundMappedToLastCycle) {
30
            return false;
30
            return false;
31
        }
31
        }
32
        return super.equals(obj);
32
        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)7.7
Clones locationClones are in different classes
Number of node comparisons142
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements17
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)10.5
    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 XYTitleAnnotation))
    3
    if (!(obj instanceof XYTitleAnnotation))
    3
    if (!(obj instanceof CyclicNumberAxis))
    Differences
    Expression1Expression2Difference
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof CyclicNumberAxis))
    4
    return false;
    4
    return false;
    5
    XYTitleAnnotation that = (XYTitleAnnotation)obj;
    5
    XYTitleAnnotation that = (XYTitleAnnotation)obj;
    7
    CyclicNumberAxis that = (CyclicNumberAxis)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    7
    CyclicNumberAxis that = (CyclicNumberAxis)obj;
    6
    if (this.coordinateType != that.coordinateType)
    6
    if (this.coordinateType != that.coordinateType)
    8
    if (this.period != that.period)
    Differences
    Expression1Expression2Difference
    coordinateTypeperiodVARIABLE_NAME_MISMATCH
    org.jfree.experimental.chart.util.XYCoordinateTypedoubleVARIABLE_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    coordinateTypeperiodVARIABLE_NAME_MISMATCH
    org.jfree.experimental.chart.util.XYCoordinateTypedoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.experimental.chart.util.XYCoordinateType of variable this.coordinateType does not match with type double of variable this.period
    Expression that.coordinateType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.period cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.experimental.chart.util.XYCoordinateType of variable that.coordinateType does not match with type double of variable that.period
    8
    if (this.period != that.period)
    7
    return false;
    9
    return false;
    8
    if (this.x != that.x)
    8
    if (this.x != that.x)
    10
    if (this.offset != that.offset)
    Differences
    Expression1Expression2Difference
    xoffsetVARIABLE_NAME_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    xoffsetVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.x cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.offset cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (this.offset != that.offset)
    9
    return false;
    11
    return false;
                                                                                                                                                        
    12
    if (!PaintUtilities.equal(this.advanceLinePaint, that.advanceLinePaint))
    Preondition Violations
    Unmatched statement if(!PaintUtilities.equal(this.advanceLinePaint,that.advanceLinePaint)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    12
    if (!PaintUtilities.equal(this.advanceLinePaint, that.advanceLinePaint))
                                      
    13
    return false;
    Preondition Violations
    Unmatched return false;
    13
    return false;
    10
    if (this.y != that.y)
    10
    if (this.y != that.y)
    16
    if (this.advanceLineVisible != that.advanceLineVisible)
    Differences
    Expression1Expression2Difference
    yadvanceLineVisibleVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    yadvanceLineVisibleVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.y does not match with type boolean of variable this.advanceLineVisible
    Expression that.y cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.advanceLineVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.y does not match with type boolean of variable that.advanceLineVisible
    16
    if (this.advanceLineVisible != that.advanceLineVisible)
    11
    return false;
    17
    return false;
    12
    if (this.maxWidth != that.maxWidth)
    12
    if (this.maxWidth != that.maxWidth)
    18
    if (this.boundMappedToLastCycle != that.boundMappedToLastCycle)
    Differences
    Expression1Expression2Difference
    maxWidthboundMappedToLastCycleVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    maxWidthboundMappedToLastCycleVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.maxWidth does not match with type boolean of variable this.boundMappedToLastCycle
    Expression that.maxWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.boundMappedToLastCycle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.maxWidth does not match with type boolean of variable that.boundMappedToLastCycle
    18
    if (this.boundMappedToLastCycle != that.boundMappedToLastCycle)
    13
    return false;
    19
    return false;
    14
    if (this.maxHeight != that.maxHeight)
    14
    if (this.maxHeight != that.maxHeight)
    Preondition Violations
    Unmatched statement if(this.maxHeight != that.maxHeight) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                    
    15
    return false;
    15
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    16
    if (!ObjectUtilities.equal(this.title, that.title))
    16
    if (!ObjectUtilities.equal(this.title, that.title))
    14
    if (!ObjectUtilities.equal(this.advanceLineStroke, that.advanceLineStroke))
    Differences
    Expression1Expression2Difference
    titleadvanceLineStrokeVARIABLE_NAME_MISMATCH
    org.jfree.chart.title.Titlejava.awt.StrokeVARIABLE_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    titleadvanceLineStrokeVARIABLE_NAME_MISMATCH
    org.jfree.chart.title.Titlejava.awt.StrokeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.title.Title of variable this.title does not match with type java.awt.Stroke of variable this.advanceLineStroke
    • Make classes org.jfree.chart.title.Title and java.awt.Stroke extend a common superclass
    Expression that.title cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.advanceLineStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.title.Title of variable that.title does not match with type java.awt.Stroke of variable that.advanceLineStroke
    • Make classes org.jfree.chart.title.Title and java.awt.Stroke extend a common superclass
    14
    if (!ObjectUtilities.equal(this.advanceLineStroke, that.advanceLineStroke))
    17
    return false;
    15
    return false;
    18
    if (!this.anchor.equals(that.anchor))
    18
    if (!this.anchor.equals(that.anchor))
    5
    if (!super.equals(obj))
    Differences
    Expression1Expression2Difference
    this.anchor.equals(that.anchor)super.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.anchor.equals(that.anchor) 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
    5
    if (!super.equals(obj))
    19
    return false;
    6
    return false;
    Precondition Violations (27)
    Row Violation
    1Type org.jfree.experimental.chart.util.XYCoordinateType of variable this.coordinateType does not match with type double of variable this.period
    2Expression that.coordinateType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.period cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type org.jfree.experimental.chart.util.XYCoordinateType of variable that.coordinateType does not match with type double of variable that.period
    5Expression that.x cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.offset cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Unmatched statement if(!PaintUtilities.equal(this.advanceLinePaint,that.advanceLinePaint)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched return false;
    9Type double of variable this.y does not match with type boolean of variable this.advanceLineVisible
    10Expression that.y cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.advanceLineVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type double of variable that.y does not match with type boolean of variable that.advanceLineVisible
    13Type double of variable this.maxWidth does not match with type boolean of variable this.boundMappedToLastCycle
    14Expression that.maxWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.boundMappedToLastCycle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type double of variable that.maxWidth does not match with type boolean of variable that.boundMappedToLastCycle
    17Unmatched statement if(this.maxHeight != that.maxHeight) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    18Unmatched return false;
    19Type org.jfree.chart.title.Title of variable this.title does not match with type java.awt.Stroke of variable this.advanceLineStroke
    20Expression that.title cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression that.advanceLineStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Type org.jfree.chart.title.Title of variable that.title does not match with type java.awt.Stroke of variable that.advanceLineStroke
    23Expression this.anchor.equals(that.anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Super method call if(!super.equals(obj)) cannot be extracted from method
    25Clone fragment #1 returns variable that with type org.jfree.experimental.chart.annotations.XYTitleAnnotation , while Clone fragment #2 returns variable that with type org.jfree.chart.axis.CyclicNumberAxis
    26Not all possible execution flows end in a return statement
    27The refactoring of the clones is infeasible, because classes org.jfree.experimental.chart.annotations.XYTitleAnnotation and org.jfree.chart.axis.CyclicNumberAxis do not have a common superclass