43-23-151

if (obj == this) { return true; } if (!(obj instanceof TimeTableXYDataset)) { return false; } TimeTableXYDataset that = (TimeTableXYDataset) obj; if (this.domainIsPointsInTime != that.domainIsPointsInTime) { return false; } if (this.xPosition != that.xPosition) { return false; } if (!this.workingCalendar.getTimeZone().equals( that.workingCalendar.getTimeZone()) ) { return false; } if (!this.values.equals(that.values)) { 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/data/time/TimeTableXYDataset.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: 14 |  | 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 TimeTableXYDataset)) {↵

4

            if (!(obj instanceof ComparableObjectSeries)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            TimeTableXYDataset that = (TimeTableXYDataset↵

7

            if (!super.equals(obj)) {↵

8

                return false;↵

9

            }↵

8

    ) obj;↵

10

            ComparableObjectSeries that = (ComparableObjectSeries) obj;↵

9

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

11

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

10

                return false;↵

12

                return false;↵

11

            }↵

13

            }↵

12

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

14

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

13

                return false;↵

15

                return false;↵

14

            }↵

16

            }↵

15

            if (!this.workingCalendar.getTimeZone().equals(↵

17

            if (this.↵

16

                that.workingCalendar.getTimeZone())↵

17

            ) {↵

18

    allowDuplicateXValues != that.allowDuplicateXValues) {↵

18

                return false;↵

19

                return false;↵

19

            }↵

20

            }↵

20

            if (!this.values.equals(that.values)) {↵

21

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

21

                return false;↵

22

                return false;↵

22

            }↵

23

            }↵

23

            return true;

24

            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) | 2.6
Clones location | Clones are in different classes
Number of node comparisons | 73

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 8
   Number of unmapped statements in the first code fragment | 3
   Number of unmapped statements in the second code fragment | 3
   Time elapsed for statement mapping (ms) | 1.3
   Clone type | Type 3

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

   1

       if (obj == this)

   1

       if (obj == this)

   2

       return true;

   2 | return true;
   2 | return true;

   Preondition Violations
   Conditional return true;
   Conditional return true;

   2

       return true;

   3

       if (!(obj instanceof TimeTableXYDataset))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.TimeTableXYDataset | org.jfree.data.ComparableObjectSeries | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof TimeTableXYDataset does not match with type boolean of variable obj instanceof ComparableObjectSeries
   - Make classes org.jfree.data.time.TimeTableXYDataset and org.jfree.data.ComparableObjectSeries extend a common superclass

   3

       if (!(obj instanceof ComparableObjectSeries))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       TimeTableXYDataset that = (TimeTableXYDataset)obj;

   7

       ComparableObjectSeries that = (ComparableObjectSeries)obj;

   8

       if (this.maximumItemCount != that.maximumItemCount)

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   6

       if (this.domainIsPointsInTime != that.domainIsPointsInTime)

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   domainIsPointsInTime | autoSort | VARIABLE_NAME_MISMATCH
   org.jfree.data.time.TimeTableXYDataset | org.jfree.data.ComparableObjectSeries | VARIABLE_TYPE_MISMATCH
   domainIsPointsInTime | autoSort | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.data.time.TimeTableXYDataset of variable that does not match with type org.jfree.data.ComparableObjectSeries of variable that
   - Make classes org.jfree.data.time.TimeTableXYDataset and org.jfree.data.ComparableObjectSeries extend a common superclass

   10

       if (this.autoSort != that.autoSort)

   7

       return false;

   7 | return false;
   11 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   11

       return false;

   8

       if (this.xPosition != that.xPosition)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

       if (!this.workingCalendar.getTimeZone().equals(that.workingCalendar.getTimeZone()))

   10 | if (! this.workingCalendar.getTimeZone().equals(that.workingCalendar.getTimeZone()))
   5 | if (! super.equals(obj))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   this.workingCalendar.getTimeZone().equals(that.workingCalendar.getTimeZone()) | super.equals(obj) | TYPE_COMPATIBLE_REPLACEMENT

   5

       if (!super.equals(obj))

   11

       return false;

   11 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

   Precondition Violations (12)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof TimeTableXYDataset does not match with type boolean of variable obj instanceof ComparableObjectSeries
   2 | Unmatched return false;
   3 | Type org.jfree.data.time.TimeTableXYDataset of variable that does not match with type org.jfree.data.ComparableObjectSeries of variable that
   4 | Unmatched return false;
   5 | Conditional return true;
   6 | Conditional return true;
   7 | Conditional return false;
   8 | Conditional return false;
   9 | Conditional return false;
   10 | Conditional return false;
   11 | Conditional return false;
   12 | Conditional return false;