398-3-11

if (obj == this) { return true; } if (!(obj instanceof VectorSeriesCollection)) { return false; } VectorSeriesCollection that = (VectorSeriesCollection) obj; return ObjectUtilities.equal(this.data, that.data);
if (obj == this) { return true; } if (!(obj instanceof CenterArrangement)) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/xy/VectorSeriesCollection.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/block/CenterArrangement.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 6 |  | Number of AST nodes: 5

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;   ↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof VectorSeriesCollection)) {↵

4

            if (!(obj instanceof CenterArrangement)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

       ↵

7

            VectorSeriesCollection that = (VectorSeriesCollection) obj;↵

7

            ↵

8

            return ObjectUtilities.equal(this.data, that.data)↵

8

    }↵

9

    ;

9

            return true;

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2
Clones location | Clones are in different classes
Number of node comparisons | 15

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 5
   Number of unmapped statements in the first code fragment | 1
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 0.5
   Clone type | Type 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 VectorSeriesCollection))

   3 | if (!(obj instanceof VectorSeriesCollection))
   3 | if (!(obj instanceof CenterArrangement))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeriesCollection | org.jfree.chart.block.CenterArrangement | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof VectorSeriesCollection does not match with type boolean of variable obj instanceof CenterArrangement
   - Make classes org.jfree.data.xy.VectorSeriesCollection and org.jfree.chart.block.CenterArrangement extend a common superclass

   3

       if (!(obj instanceof CenterArrangement))

   4

       return false;

   4

       return false;

   5

       VectorSeriesCollection that = (VectorSeriesCollection)obj;

   6

       return ObjectUtilities.equal(this.data, that.data);

   6 | return ObjectUtilities.equal(this.data, that.data);
   5 | return true;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   ObjectUtilities.equal(this.data,that.data) | true | TYPE_COMPATIBLE_REPLACEMENT

   5

       return true;

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof VectorSeriesCollection does not match with type boolean of variable obj instanceof CenterArrangement