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 (obj == this) { return true; } if (!(obj instanceof NumberAxis)) { return false; } if (!super.equals(obj)) { return false; } NumberAxis that = (NumberAxis) obj; if (this.autoRangeIncludesZero != that.autoRangeIncludesZero) { return false; } if (this.autoRangeStickyZero != that.autoRangeStickyZero) { return false; } if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) { return false; } if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride)) { return false; } if (!this.rangeType.equals(that.rangeType)) { 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/axis/NumberAxis.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 (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof DateAxis)) {
4
        if (!(obj instanceof NumberAxis)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        Date
7
        if (!super.equals(obj)) {
8
            return false;
9
        }
8
Axis that = (DateAxis) obj;
10
        NumberAxis that = (NumberAxis) obj;
9
        if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) {
11
        if (this.autoRangeIncludesZero != that.autoRangeIncludesZero) {
10
            return false;
12
            return false;
11
        }
13
        }
12
        if (!ObjectUtilities.equal(this.dateFormatOverride,
14
        if (
13
                that.dateFormatOverride)) {
15
this.autoRangeStickyZero != that.autoRangeStickyZero) {
14
            return false;
16
            return false;
15
        }
17
        }
16
        if (!ObjectUtilities.equal(this.tickMarkPosition,
18
        if (!ObjectUtilities.equal(this.tick
17
                that.tickMarkPosition)) {
19
Unit, that.tickUnit)) {
18
            return false;
20
            return false;
19
        }
21
        }
20
        if (!ObjectUtilities.equal(this.timeline, that.timelin
22
        if (!ObjectUtilities.equal(this.numberFormatOverride,
21
e)) {
23
                that.numberFormatOverride)) {
22
            return false;
24
            return false;
23
        }
25
        }
24
        if (!super.equals(obj)) {
26
        if (!this.rangeType.equals(that.rangeType)) {
25
            return false;
27
            return false;
26
        }
28
        }
27
        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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons105
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)9.0
    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 DateAxis))
    3
    if (!(obj instanceof DateAxis))
    3
    if (!(obj instanceof NumberAxis))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.DateAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof NumberAxis))
    4
    return false;
    4
    return false;
    5
    DateAxis that = (DateAxis)obj;
    5
    DateAxis that = (DateAxis)obj;
    7
    NumberAxis that = (NumberAxis)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.DateAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    7
    NumberAxis that = (NumberAxis)obj;
                                                                                                                                  
    8
    if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)
    Preondition Violations
    Unmatched statement if(this.autoRangeIncludesZero != that.autoRangeIncludesZero) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)
                                    
    9
    return false;
    Preondition Violations
    Unmatched return false;
    9
    return false;
                                                                                                                            
    10
    if (this.autoRangeStickyZero != that.autoRangeStickyZero)
    Preondition Violations
    Unmatched statement if(this.autoRangeStickyZero != that.autoRangeStickyZero) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    10
    if (this.autoRangeStickyZero != that.autoRangeStickyZero)
                                      
    11
    return false;
    Preondition Violations
    Unmatched return false;
    11
    return false;
    6
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    6
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    12
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.DateTickUnitorg.jfree.chart.axis.NumberTickUnitSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.DateTickUnitorg.jfree.chart.axis.NumberTickUnitSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    7
    return false;
    13
    return false;
    8
    if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride))
    8
    if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride))
    14
    if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride))
    Differences
    Expression1Expression2Difference
    dateFormatOverridenumberFormatOverrideVARIABLE_NAME_MISMATCH
    java.text.DateFormatjava.text.NumberFormatSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    dateFormatOverridenumberFormatOverrideVARIABLE_NAME_MISMATCH
    java.text.DateFormatjava.text.NumberFormatSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.dateFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.numberFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride))
    9
    return false;
    15
    return false;
    10
    if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition))
    10
    if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition))
    5
    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
    5
    if (!super.equals(obj))
    11
    return false;
    6
    return false;
    12
    if (!ObjectUtilities.equal(this.timeline, that.timeline))
    12
    if (!ObjectUtilities.equal(this.timeline, that.timeline))
    16
    if (!this.rangeType.equals(that.rangeType))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.timeline,that.timeline)this.rangeType.equals(that.rangeType)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.timeline,that.timeline) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.rangeType.equals(that.rangeType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    if (!this.rangeType.equals(that.rangeType))
    13
    return false;
    17
    return false;
    Precondition Violations (14)
    Row Violation
    1Unmatched statement if(this.autoRangeIncludesZero != that.autoRangeIncludesZero) 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.autoRangeStickyZero != that.autoRangeStickyZero) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched return false;
    5Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.dateFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.numberFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression ObjectUtilities.equal(this.tickMarkPosition,that.tickMarkPosition) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Super method call if(!super.equals(obj)) cannot be extracted from method
    11Expression ObjectUtilities.equal(this.timeline,that.timeline) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression this.rangeType.equals(that.rangeType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Clone fragment #1 returns variables , while Clone fragment #2 returns variables that
    14Not all possible execution flows end in a return statement