if (obj == this) { return true; } if (!(obj instanceof BoxAndWhiskerRenderer)) { return false; } if (!super.equals(obj)) { return false; } BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer) obj; if (!PaintUtilities.equal(this.artifactPaint, that.artifactPaint)) { return false; } if (this.fillBox != that.fillBox) { return false; } if (this.itemMargin != that.itemMargin) { return false; } if (this.maximumBarWidth != that.maximumBarWidth) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof ComparableObjectSeries)) { return false; } if (!super.equals(obj)) { return false; } ComparableObjectSeries that = (ComparableObjectSeries) obj; if (this.maximumItemCount != that.maximumItemCount) { return false; } if (this.autoSort != that.autoSort) { return false; } if (this.allowDuplicateXValues != that.allowDuplicateXValues) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/BoxAndWhiskerRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/data/ComparableObjectSeries.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 16 Number of AST nodes: 16
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof BoxAndWhiskerRenderer)) {
4
        if (!(obj instanceof ComparableObjectSeries)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!super.equals(obj)) {
7
        if (!super.equals(obj)) {
8
            return false;
8
            return false;
9
        }
9
        }
10
        BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer) obj;
10
        
11
        if (!PaintUtilities.equal(this.artifactPaint, that.artifactPai
11
ComparableObjectSeries that = (ComparableObjectSeries) obj;
12
nt)) {
12
        if (this.maximumItemCount != that.maximumItemCount) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (this.fillBox != that.fillBox) {
15
        if (this.autoSort != that.autoSort) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (this.itemMargin != that.itemMargin) {
18
        if (this.allowDuplicateXValues != that.allowDuplicateXValues) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (this.maximumBarWidth != that.maximumBarWidth) {
21
        if (!ObjectUtilities.equal(this.data, that.data)) {
22
            return false;
22
            return false;
23
        }
23
        }
24
        return true;
24
        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)3.7
Clones locationClones are in different classes
Number of node comparisons92
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements15
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)4.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (obj == this)
    1
    if (obj == this)
    2
    return true;
    2
    return true;
    3
    if (!(obj instanceof BoxAndWhiskerRenderer))
    3
    if (!(obj instanceof BoxAndWhiskerRenderer))
    3
    if (!(obj instanceof ComparableObjectSeries))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.category.BoxAndWhiskerRendererorg.jfree.data.ComparableObjectSeriesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.renderer.category.BoxAndWhiskerRenderer does not match with type org.jfree.data.ComparableObjectSeries
    • Make classes org.jfree.chart.renderer.category.BoxAndWhiskerRenderer and org.jfree.data.ComparableObjectSeries extend a common superclass
    3
    if (!(obj instanceof ComparableObjectSeries))
    4
    return false;
    4
    return false;
    5
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    Preondition Violations
    Super method call if(!super.equals(obj)) cannot be extracted from method
    Super method call if(!super.equals(obj)) cannot be extracted from method
    5
    if (!super.equals(obj))
    6
    return false;
    6
    return false;
                                                                                                                          
    7
    ComparableObjectSeries that = (ComparableObjectSeries)obj;
    7
    BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer)obj;
                                                                                                                      
    8
    if (!PaintUtilities.equal(this.artifactPaint, that.artifactPaint))
    8
    if (!PaintUtilities.equal(this.artifactPaint, that.artifactPaint))
    14
    if (!ObjectUtilities.equal(this.data, that.data))
    Differences
    Expression1Expression2Difference
    artifactPaintdataVARIABLE_NAME_MISMATCH
    java.awt.Paintjava.util.ListVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.category.BoxAndWhiskerRendererorg.jfree.data.ComparableObjectSeriesVARIABLE_TYPE_MISMATCH
    artifactPaintdataVARIABLE_NAME_MISMATCH
    java.awt.Paintjava.util.ListVARIABLE_TYPE_MISMATCH
    org.jfree.util.PaintUtilitiesorg.jfree.util.ObjectUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Paint of variable this.artifactPaint does not match with type java.util.List of variable this.data
    • Make classes java.awt.Paint and java.util.List extend a common superclass
    Type java.awt.Paint of variable that.artifactPaint does not match with type java.util.List of variable that.data
    • Make classes org.jfree.chart.renderer.category.BoxAndWhiskerRenderer and org.jfree.data.ComparableObjectSeries extend a common superclass
    Expression that.artifactPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.data cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.awt.Paint of variable that.artifactPaint does not match with type java.util.List of variable that.data
    • Make classes java.awt.Paint and java.util.List extend a common superclass
    Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities
    • Make classes org.jfree.util.PaintUtilities and org.jfree.util.ObjectUtilities extend a common superclass
    14
    if (!ObjectUtilities.equal(this.data, that.data))
    9
    return false;
    15
    return false;
    10
    if (this.fillBox != that.fillBox)
    10
    if (this.fillBox != that.fillBox)
    10
    if (this.autoSort != that.autoSort)
    Differences
    Expression1Expression2Difference
    fillBoxautoSortVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.category.BoxAndWhiskerRendererorg.jfree.data.ComparableObjectSeriesVARIABLE_TYPE_MISMATCH
    fillBoxautoSortVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type boolean of variable that.fillBox does not match with type boolean of variable that.autoSort
    • Make classes org.jfree.chart.renderer.category.BoxAndWhiskerRenderer and org.jfree.data.ComparableObjectSeries extend a common superclass
    Expression that.fillBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.autoSort cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (this.autoSort != that.autoSort)
    11
    return false;
    11
    return false;
    12
    if (this.itemMargin != that.itemMargin)
    12
    if (this.itemMargin != that.itemMargin)
    12
    if (this.allowDuplicateXValues != that.allowDuplicateXValues)
    Differences
    Expression1Expression2Difference
    itemMarginallowDuplicateXValuesVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.category.BoxAndWhiskerRendererorg.jfree.data.ComparableObjectSeriesVARIABLE_TYPE_MISMATCH
    itemMarginallowDuplicateXValuesVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.itemMargin does not match with type boolean of variable this.allowDuplicateXValues
    Type double of variable that.itemMargin does not match with type boolean of variable that.allowDuplicateXValues
    • Make classes org.jfree.chart.renderer.category.BoxAndWhiskerRenderer and org.jfree.data.ComparableObjectSeries extend a common superclass
    Expression that.itemMargin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.allowDuplicateXValues cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.itemMargin does not match with type boolean of variable that.allowDuplicateXValues
    12
    if (this.allowDuplicateXValues != that.allowDuplicateXValues)
    13
    return false;
    13
    return false;
    14
    if (this.maximumBarWidth != that.maximumBarWidth)
    14
    if (this.maximumBarWidth != that.maximumBarWidth)
    8
    if (this.maximumItemCount != that.maximumItemCount)
    Differences
    Expression1Expression2Difference
    maximumBarWidthmaximumItemCountVARIABLE_NAME_MISMATCH
    doubleintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.category.BoxAndWhiskerRendererorg.jfree.data.ComparableObjectSeriesVARIABLE_TYPE_MISMATCH
    maximumBarWidthmaximumItemCountVARIABLE_NAME_MISMATCH
    doubleintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.maximumBarWidth does not match with type int of variable this.maximumItemCount
    Type double of variable that.maximumBarWidth does not match with type int of variable that.maximumItemCount
    • Make classes org.jfree.chart.renderer.category.BoxAndWhiskerRenderer and org.jfree.data.ComparableObjectSeries extend a common superclass
    Expression that.maximumBarWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.maximumItemCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.maximumBarWidth does not match with type int of variable that.maximumItemCount
    8
    if (this.maximumItemCount != that.maximumItemCount)
    15
    return false;
    9
    return false;
    16
    return true;
    16
    return true;
    Precondition Violations (23)
    Row Violation
    1Type org.jfree.chart.renderer.category.BoxAndWhiskerRenderer does not match with type org.jfree.data.ComparableObjectSeries
    2Super method call if(!super.equals(obj)) cannot be extracted from method
    3Super method call if(!super.equals(obj)) cannot be extracted from method
    4Type java.awt.Paint of variable this.artifactPaint does not match with type java.util.List of variable this.data
    5Type java.awt.Paint of variable that.artifactPaint does not match with type java.util.List of variable that.data
    6Expression that.artifactPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.data cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type java.awt.Paint of variable that.artifactPaint does not match with type java.util.List of variable that.data
    9Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities
    10Type boolean of variable that.fillBox does not match with type boolean of variable that.autoSort
    11Expression that.fillBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.autoSort cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Type double of variable this.itemMargin does not match with type boolean of variable this.allowDuplicateXValues
    14Type double of variable that.itemMargin does not match with type boolean of variable that.allowDuplicateXValues
    15Expression that.itemMargin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression that.allowDuplicateXValues cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Type double of variable that.itemMargin does not match with type boolean of variable that.allowDuplicateXValues
    18Type double of variable this.maximumBarWidth does not match with type int of variable this.maximumItemCount
    19Type double of variable that.maximumBarWidth does not match with type int of variable that.maximumItemCount
    20Expression that.maximumBarWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression that.maximumItemCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Type double of variable that.maximumBarWidth does not match with type int of variable that.maximumItemCount
    23The refactoring of the clones is infeasible, because classes org.jfree.chart.renderer.category.BoxAndWhiskerRenderer and org.jfree.data.ComparableObjectSeries do not have a common superclass