292-8-10

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;
if (obj == this) { return true; } if (!(obj instanceof XYSeries)) { return false; } if (!super.equals(obj)) { return false; } XYSeries that = (XYSeries) 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/data/ComparableObjectSeries.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/xy/XYSeries.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 ComparableObjectSeries)) {↵

4

            if (!(obj instanceof XYSeries)) {↵

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

            ComparableObjectSeries that = (ComparableObjectSeries) obj;↵

10

            XYSeries that = (XYSeries) obj;↵

11

            if (this.maximumItemCount != that.maximumItemCount) {↵

11

            if (this.maximumItemCount != that.maximumItemCount) {↵

12

                return false;↵

12

                return false;↵

13

            }↵

13

            }↵

14

            if (this.autoSort != that.autoSort) {↵

14

            if (this.autoSort != that.autoSort) {↵

15

                return false;↵

15

                return false;↵

16

            }↵

16

            }↵

17

            if (this.allowDuplicateXValues != that.allowDuplicateXValues) {↵

17

            if (this.allowDuplicateXValues != that.allowDuplicateXValues) {↵

18

                return false;↵

18

                return false;↵

19

            }↵

19

            }↵

20

            if (!ObjectUtilities.equal(this.data, that.data)) {↵

20

            if (!ObjectUtilities.equal(this.data, that.data)) {↵

21

                return false;↵

21

                return false;↵

22

            }↵

22

            }↵

23

            return true;

23

            return true;

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) | 2.1
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 137

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 16
   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) | 1.9
   Clone type | Type 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 ComparableObjectSeries))

   3 | if (!(obj instanceof ComparableObjectSeries))
   3 | if (!(obj instanceof XYSeries))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.ComparableObjectSeries | org.jfree.data.xy.XYSeries | SUBCLASS_TYPE_MISMATCH

   3

       if (!(obj instanceof XYSeries))

   4

       return false;

   4

       return false;

   5

       if (!super.equals(obj))

   5

       if (!super.equals(obj))

   6

       return false;

   6

       return false;

   7

       ComparableObjectSeries that = (ComparableObjectSeries)obj;

   7 | ComparableObjectSeries that = (ComparableObjectSeries)obj;
   7 | XYSeries that = (XYSeries)obj;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.ComparableObjectSeries | org.jfree.data.xy.XYSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.ComparableObjectSeries | org.jfree.data.xy.XYSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.ComparableObjectSeries | org.jfree.data.xy.XYSeries | SUBCLASS_TYPE_MISMATCH

   7

       XYSeries that = (XYSeries)obj;

   8

       if (this.maximumItemCount != that.maximumItemCount)

   8 | if (this.maximumItemCount != that.maximumItemCount)
   8 | if (this.maximumItemCount != that.maximumItemCount)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.ComparableObjectSeries | org.jfree.data.xy.XYSeries | SUBCLASS_TYPE_MISMATCH

   8

       if (this.maximumItemCount != that.maximumItemCount)

   9

       return false;

   9

       return false;

   10

       if (this.autoSort != that.autoSort)

   10 | if (this.autoSort != that.autoSort)
   10 | if (this.autoSort != that.autoSort)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.ComparableObjectSeries | org.jfree.data.xy.XYSeries | SUBCLASS_TYPE_MISMATCH

   10

       if (this.autoSort != that.autoSort)

   11

       return false;

   11

       return false;

   12

       if (this.allowDuplicateXValues != that.allowDuplicateXValues)

   12 | if (this.allowDuplicateXValues != that.allowDuplicateXValues)
   12 | if (this.allowDuplicateXValues != that.allowDuplicateXValues)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.ComparableObjectSeries | org.jfree.data.xy.XYSeries | SUBCLASS_TYPE_MISMATCH

   12

       if (this.allowDuplicateXValues != that.allowDuplicateXValues)

   13

       return false;

   13

       return false;

   14

       if (!ObjectUtilities.equal(this.data, that.data))

   14 | if (! ObjectUtilities.equal(this.data, that.data))
   14 | if (! ObjectUtilities.equal(this.data, that.data))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.ComparableObjectSeries | org.jfree.data.xy.XYSeries | SUBCLASS_TYPE_MISMATCH

   14

       if (!ObjectUtilities.equal(this.data, that.data))

   15

       return false;

   15

       return false;

   16

       return true;

   16

       return true;

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