if (obj == this) { return true; } if (!(obj instanceof XYLineAndShapeRenderer)) { return false; } XYStepRenderer that = (XYStepRenderer) obj; if (this.stepPoint != that.stepPoint) { return false; } return super.equals(obj);
if (obj == null) { return false; } if (obj == this) { return true; } if (obj instanceof MatrixSeriesCollection) { MatrixSeriesCollection c = (MatrixSeriesCollection) obj; return ObjectUtilities.equal(this.seriesList, c.seriesList); } return false;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYStepRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/data/xy/MatrixSeriesCollection.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (obj == this) {
1
if (obj == null) {
2
            return true;
2
            return false;
3
        }
3
        }
4
        if (!(obj instanceof XYLineAndShapeRenderer)) {
4
        if (obj == this) {
5
            return false;
5
            return true;
6
        }
6
        }
7
        XYStepRenderer that = (XYStepRenderer) obj;
7
        
8
        if (this.stepPoint != that.stepPoint) {
9
            return false
8
if (obj instanceof MatrixSeriesCollection) {
9
            MatrixSeriesCollection c = (MatrixSeriesCollection) obj;
10
;
10
            return ObjectUtilities.equal(this.seriesList, c.seriesList);
11
        }
11
        }
12
        return super.equals(obj);
12
        return false;
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)0.7
Clones locationClones are in different classes
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (obj == this)
    3
    if (obj == this)
    2
    return true;
    4
    return true;
    3
    if (!(obj instanceof XYLineAndShapeRenderer))
    3
    if (!(obj instanceof XYLineAndShapeRenderer))
    5
    if (obj instanceof MatrixSeriesCollection)
    Differences
    Expression1Expression2Difference
    !(obj instanceof XYLineAndShapeRenderer)obj instanceof MatrixSeriesCollectionTYPE_COMPATIBLE_REPLACEMENT
    5
    if (obj instanceof MatrixSeriesCollection)
                                                                                                                    
    6
    MatrixSeriesCollection c = (MatrixSeriesCollection)obj;
    Preondition Violations
    Unmatched statement MatrixSeriesCollection c=(MatrixSeriesCollection)obj; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6
    MatrixSeriesCollection c = (MatrixSeriesCollection)obj;
    4
    return false;
    4
    return false;
    7
    return ObjectUtilities.equal(this.seriesList, c.seriesList);
    Differences
    Expression1Expression2Difference
    falseObjectUtilities.equal(this.seriesList,c.seriesList)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.seriesList,c.seriesList) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    return ObjectUtilities.equal(this.seriesList, c.seriesList);
    Precondition Violations (4)
    Row Violation
    1Unmatched statement MatrixSeriesCollection c=(MatrixSeriesCollection)obj; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Expression ObjectUtilities.equal(this.seriesList,c.seriesList) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Not all possible execution flows end in a return statement
    4The refactoring of the clones is infeasible, because classes org.jfree.chart.renderer.xy.XYStepRenderer and org.jfree.data.xy.MatrixSeriesCollection do not have a common superclass