295-1-3

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;
if (object == null) { return false; } if (object == this) { return true; } if (super.equals(object) && object instanceof ShipNeedle) { return true; } return false;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/xy/MatrixSeriesCollection.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/needle/ShipNeedle.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 8 |  | Number of AST nodes: 7

1

    if (obj == null) {↵

1

    if (object == null) {↵

2

                return false;↵

2

                return false;↵

3

            }↵

3

            }↵

4

            if (obj == this) {↵

4

            if (object == this) {↵

5

                return true;↵

5

                return true;↵

6

            }↵

6

            }↵

7

            if (obj instanceof MatrixSeriesCollection) {↵

7

            if (↵

8

                MatrixSeriesCollection c = (MatrixSeriesCollection) obj;↵

9

                return ObjectUtilities.equal(this.seriesList, c.seriesList)↵

8

    super.equals(object) && object instanceof ShipNeedle) {↵

10

    ;↵

9

                return true;↵

11

            }↵

10

            }↵

12

            return false;

11

            return false;

See real code fragment |  | See real code fragment

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

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 4
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 0.3
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   1

       if (obj == null)

   1 | if (obj == null)
   1 | if (object == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   obj | object | VARIABLE_NAME_MISMATCH

   1

       if (object == null)

   2

       return false;

   2

       return false;

   3

       if (obj == this)

   3 | if (obj == this)
   3 | if (object == this)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   obj | object | VARIABLE_NAME_MISMATCH

   3

       if (object == this)

   4

       return true;

   4

       return true;

   Precondition Violations (0)
   Row | Violation
   --- | ---