if (obj == this) { return true; } if (!(obj instanceof DialPlot)) { return false; } DialPlot that = (DialPlot) obj; if (!ObjectUtilities.equal(this.background, that.background)) { return false; } if (!ObjectUtilities.equal(this.cap, that.cap)) { return false; } if (!this.dialFrame.equals(that.dialFrame)) { return false; } if (this.viewX != that.viewX) { return false; } if (this.viewY != that.viewY) { return false; } if (this.viewW != that.viewW) { return false; } if (this.viewH != that.viewH) { return false; } if (!this.layers.equals(that.layers)) { return false; } if (!this.pointers.equals(that.pointers)) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof RelativeDateFormat)) { return false; } if (!super.equals(obj)) { return false; } RelativeDateFormat that = (RelativeDateFormat) obj; if (this.baseMillis != that.baseMillis) { return false; } if (this.showZeroDays != that.showZeroDays) { return false; } if (this.showZeroHours != that.showZeroHours) { return false; } if (!this.positivePrefix.equals(that.positivePrefix)) { return false; } if (!this.daySuffix.equals(that.daySuffix)) { return false; } if (!this.hourSuffix.equals(that.hourSuffix)) { return false; } if (!this.minuteSuffix.equals(that.minuteSuffix)) { return false; } if (!this.secondSuffix.equals(that.secondSuffix)) { return false; } if (!this.secondFormatter.equals(that.secondFormatter)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/DialPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/util/RelativeDateFormat.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 24 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 DialPlot)) {
4
        if (!(obj instanceof RelativeDateFormat)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        DialPlot that = (DialPlot) obj;
7
        
8
        if (!ObjectUtilities.equal(this.background, that.background)
8
if (!super.equals(obj)) {
9
            return false;
10
        }
11
        RelativeDateFormat that = (RelativeDateFormat) obj;
9
) {
12
        if (this.baseMillis != that.baseMillis) {
10
            return false;
13
            return false;
11
        }
14
        }
12
        if (!ObjectUtilities.equal(this.cap, that.cap)) {
15
        if (this.showZeroDays != that.showZeroDays) {
13
            return false;
16
            return false;
14
        }
17
        }
15
        if (!this.dialFrame.equals(that.dialFrame)) {
18
        if (this.showZeroHours != that.showZeroHours) {
16
            return false;
19
            return false;
17
        }
20
        }
18
        if (this.viewX != that.viewX) {
21
        if (!this.positivePrefix.equals(that.positivePrefix)) {
19
            return false;
22
            return false;
20
        }
23
        }
21
        if (this.viewY != that.viewY) {
24
        if (!this.daySuffix.equals(that.daySuffix)) {
22
            return false;
25
            return false;
23
        }
26
        }
24
        if (this.viewW != that.viewW) {
27
        if (!this.hourSuffix.equals(that.hourSuffix)) {
25
            return false;
28
            return false;
26
        }
29
        }
27
        if (this.viewH != that.viewH) {
30
        if (!this.minuteSuffix.equals(that.minuteSuffix)) {
28
            return false;
31
            return false;
29
        }
32
        }
30
        if (!this.layers.equals(that.layers)) {
33
        if (!this.secondSuffix.equals(that.secondSuffix)) {
31
            return false;
34
            return false;
32
        }
35
        }
33
        if (!this.pointers.equals(that.pointers)) {
36
        if (!this.secondFormatter.equals(that.secondFormatter)) {
34
            return false;
37
            return false;
35
        }
38
        }
36
        return super.equals(obj);
39
        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)15.4
Clones locationClones are in different classes
Number of node comparisons217
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements20
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)9.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 DialPlot))
    3
    if (!(obj instanceof DialPlot))
    3
    if (!(obj instanceof RelativeDateFormat))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.util.RelativeDateFormatVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.plot.dial.DialPlot does not match with type org.jfree.chart.util.RelativeDateFormat
    • Make classes org.jfree.chart.plot.dial.DialPlot and org.jfree.chart.util.RelativeDateFormat extend a common superclass
    3
    if (!(obj instanceof RelativeDateFormat))
    4
    return false;
    4
    return false;
    5
    DialPlot that = (DialPlot)obj;
                                                                  
    6
    if (!ObjectUtilities.equal(this.background, that.background))
    6
    if (!ObjectUtilities.equal(this.background, that.background))
    5
    if (!super.equals(obj))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.background,that.background)super.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.background,that.background) 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))
    7
    return false;
    6
    return false;
                                                                                                          
    7
    RelativeDateFormat that = (RelativeDateFormat)obj;
    8
    if (!ObjectUtilities.equal(this.cap, that.cap))
    8
    if (!ObjectUtilities.equal(this.cap, that.cap))
    14
    if (!this.positivePrefix.equals(that.positivePrefix))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.cap,that.cap)this.positivePrefix.equals(that.positivePrefix)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.cap,that.cap) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.positivePrefix.equals(that.positivePrefix) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (!this.positivePrefix.equals(that.positivePrefix))
    9
    return false;
    15
    return false;
    10
    if (!this.dialFrame.equals(that.dialFrame))
    10
    if (!this.dialFrame.equals(that.dialFrame))
    16
    if (!this.daySuffix.equals(that.daySuffix))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.util.RelativeDateFormatVARIABLE_TYPE_MISMATCH
    dialFramedaySuffixVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialFramejava.lang.StringVARIABLE_TYPE_MISMATCH
    dialFramedaySuffixVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialFramejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.plot.dial.DialFrame of variable that.dialFrame does not match with type java.lang.String of variable that.daySuffix
    • Make classes org.jfree.chart.plot.dial.DialPlot and org.jfree.chart.util.RelativeDateFormat extend a common superclass
    Expression that.dialFrame cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.daySuffix cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.plot.dial.DialFrame of variable that.dialFrame does not match with type java.lang.String of variable that.daySuffix
    • Make classes org.jfree.chart.plot.dial.DialFrame and java.lang.String extend a common superclass
    Type org.jfree.chart.plot.dial.DialFrame of variable this.dialFrame does not match with type java.lang.String of variable this.daySuffix
    • Make classes org.jfree.chart.plot.dial.DialFrame and java.lang.String extend a common superclass
    16
    if (!this.daySuffix.equals(that.daySuffix))
    11
    return false;
    17
    return false;
    12
    if (this.viewX != that.viewX)
    12
    if (this.viewX != that.viewX)
    12
    if (this.showZeroHours != that.showZeroHours)
    Differences
    Expression1Expression2Difference
    viewXshowZeroHoursVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.util.RelativeDateFormatVARIABLE_TYPE_MISMATCH
    viewXshowZeroHoursVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.viewX does not match with type boolean of variable this.showZeroHours
    Type double of variable that.viewX does not match with type boolean of variable that.showZeroHours
    • Make classes org.jfree.chart.plot.dial.DialPlot and org.jfree.chart.util.RelativeDateFormat extend a common superclass
    Expression that.viewX cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.showZeroHours cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.viewX does not match with type boolean of variable that.showZeroHours
    12
    if (this.showZeroHours != that.showZeroHours)
    13
    return false;
    13
    return false;
    14
    if (this.viewY != that.viewY)
    14
    if (this.viewY != that.viewY)
    10
    if (this.showZeroDays != that.showZeroDays)
    Differences
    Expression1Expression2Difference
    viewYshowZeroDaysVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.util.RelativeDateFormatVARIABLE_TYPE_MISMATCH
    viewYshowZeroDaysVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.viewY does not match with type boolean of variable this.showZeroDays
    Type double of variable that.viewY does not match with type boolean of variable that.showZeroDays
    • Make classes org.jfree.chart.plot.dial.DialPlot and org.jfree.chart.util.RelativeDateFormat extend a common superclass
    Expression that.viewY cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.showZeroDays cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.viewY does not match with type boolean of variable that.showZeroDays
    10
    if (this.showZeroDays != that.showZeroDays)
    15
    return false;
    11
    return false;
    16
    if (this.viewW != that.viewW)
    16
    if (this.viewW != that.viewW)
    8
    if (this.baseMillis != that.baseMillis)
    Differences
    Expression1Expression2Difference
    viewWbaseMillisVARIABLE_NAME_MISMATCH
    doublelongVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.util.RelativeDateFormatVARIABLE_TYPE_MISMATCH
    viewWbaseMillisVARIABLE_NAME_MISMATCH
    doublelongVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.viewW does not match with type long of variable this.baseMillis
    Type double of variable that.viewW does not match with type long of variable that.baseMillis
    • Make classes org.jfree.chart.plot.dial.DialPlot and org.jfree.chart.util.RelativeDateFormat extend a common superclass
    Expression that.viewW cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.baseMillis cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.viewW does not match with type long of variable that.baseMillis
    8
    if (this.baseMillis != that.baseMillis)
    17
    return false;
    9
    return false;
    18
    if (this.viewH != that.viewH)
                                                                    
    19
    return false;
    19
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    20
    if (!this.layers.equals(that.layers))
    20
    if (!this.layers.equals(that.layers))
    20
    if (!this.minuteSuffix.equals(that.minuteSuffix))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.util.RelativeDateFormatVARIABLE_TYPE_MISMATCH
    layersminuteSuffixVARIABLE_NAME_MISMATCH
    java.util.Listjava.lang.StringVARIABLE_TYPE_MISMATCH
    layersminuteSuffixVARIABLE_NAME_MISMATCH
    java.util.Listjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.List of variable that.layers does not match with type java.lang.String of variable that.minuteSuffix
    • Make classes org.jfree.chart.plot.dial.DialPlot and org.jfree.chart.util.RelativeDateFormat extend a common superclass
    Expression that.layers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.minuteSuffix cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.util.List of variable that.layers does not match with type java.lang.String of variable that.minuteSuffix
    • Make classes java.util.List and java.lang.String extend a common superclass
    Type java.util.List of variable this.layers does not match with type java.lang.String of variable this.minuteSuffix
    • Make classes java.util.List and java.lang.String extend a common superclass
    20
    if (!this.minuteSuffix.equals(that.minuteSuffix))
    21
    return false;
    21
    return false;
    22
    if (!this.pointers.equals(that.pointers))
    22
    if (!this.pointers.equals(that.pointers))
    18
    if (!this.hourSuffix.equals(that.hourSuffix))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.util.RelativeDateFormatVARIABLE_TYPE_MISMATCH
    pointershourSuffixVARIABLE_NAME_MISMATCH
    java.util.Listjava.lang.StringVARIABLE_TYPE_MISMATCH
    pointershourSuffixVARIABLE_NAME_MISMATCH
    java.util.Listjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.List of variable that.pointers does not match with type java.lang.String of variable that.hourSuffix
    • Make classes org.jfree.chart.plot.dial.DialPlot and org.jfree.chart.util.RelativeDateFormat extend a common superclass
    Expression that.pointers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.hourSuffix cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.util.List of variable that.pointers does not match with type java.lang.String of variable that.hourSuffix
    • Make classes java.util.List and java.lang.String extend a common superclass
    Type java.util.List of variable this.pointers does not match with type java.lang.String of variable this.hourSuffix
    • Make classes java.util.List and java.lang.String extend a common superclass
    18
    if (!this.hourSuffix.equals(that.hourSuffix))
    23
    return false;
    19
    return false;
    Precondition Violations (38)
    Row Violation
    1Type org.jfree.chart.plot.dial.DialPlot does not match with type org.jfree.chart.util.RelativeDateFormat
    2Expression ObjectUtilities.equal(this.background,that.background) 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 ObjectUtilities.equal(this.cap,that.cap) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression this.positivePrefix.equals(that.positivePrefix) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type org.jfree.chart.plot.dial.DialFrame of variable that.dialFrame does not match with type java.lang.String of variable that.daySuffix
    7Expression that.dialFrame cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.daySuffix cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Type org.jfree.chart.plot.dial.DialFrame of variable that.dialFrame does not match with type java.lang.String of variable that.daySuffix
    10Type org.jfree.chart.plot.dial.DialFrame of variable this.dialFrame does not match with type java.lang.String of variable this.daySuffix
    11Type double of variable this.viewX does not match with type boolean of variable this.showZeroHours
    12Type double of variable that.viewX does not match with type boolean of variable that.showZeroHours
    13Expression that.viewX cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.showZeroHours cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type double of variable that.viewX does not match with type boolean of variable that.showZeroHours
    16Type double of variable this.viewY does not match with type boolean of variable this.showZeroDays
    17Type double of variable that.viewY does not match with type boolean of variable that.showZeroDays
    18Expression that.viewY cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression that.showZeroDays cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Type double of variable that.viewY does not match with type boolean of variable that.showZeroDays
    21Type double of variable this.viewW does not match with type long of variable this.baseMillis
    22Type double of variable that.viewW does not match with type long of variable that.baseMillis
    23Expression that.viewW cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Expression that.baseMillis cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Type double of variable that.viewW does not match with type long of variable that.baseMillis
    26Unmatched return false;
    27Type java.util.List of variable that.layers does not match with type java.lang.String of variable that.minuteSuffix
    28Expression that.layers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    29Expression that.minuteSuffix cannot be parameterized, because it has dependencies to/from statements that will be extracted
    30Type java.util.List of variable that.layers does not match with type java.lang.String of variable that.minuteSuffix
    31Type java.util.List of variable this.layers does not match with type java.lang.String of variable this.minuteSuffix
    32Type java.util.List of variable that.pointers does not match with type java.lang.String of variable that.hourSuffix
    33Expression that.pointers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    34Expression that.hourSuffix cannot be parameterized, because it has dependencies to/from statements that will be extracted
    35Type java.util.List of variable that.pointers does not match with type java.lang.String of variable that.hourSuffix
    36Type java.util.List of variable this.pointers does not match with type java.lang.String of variable this.hourSuffix
    37Not all possible execution flows end in a return statement
    38The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.dial.DialPlot and org.jfree.chart.util.RelativeDateFormat do not have a common superclass