43-23-61

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 DefaultBoxAndWhiskerXYDataset)) { return false; } DefaultBoxAndWhiskerXYDataset that = (DefaultBoxAndWhiskerXYDataset) obj; if (!ObjectUtilities.equal(this.seriesKey, that.seriesKey)) { return false; } if (!this.dates.equals(that.dates)) { return false; } if (!this.items.equals(that.items)) { 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/statistics/DefaultBoxAndWhiskerXYDataset.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 14 |  | Number of AST nodes: 12

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 DefaultBoxAndWhiskerXYDataset)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            TimeTableXYDataset that = (TimeTableXYDataset) obj;↵

7

            ↵

8

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

9

                return false;↵

10

            }↵

11

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

12

                return false;↵

13

            }↵

14

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

15

                that.workingCalendar.getTimeZone())↵

16

            ↵

8

    DefaultBoxAndWhiskerXYDataset that ↵

9

                    = (DefaultBoxAndWhiskerXYDataset) obj;↵

10

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

11

                return false;↵

12

            }↵

17

    ) {↵

13

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

18

                return false;↵

14

                return false;↵

19

            }↵

15

            }↵

20

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

16

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

21

                return false;↵

17

                return false;↵

22

            }↵

18

            }↵

23

            return true;

19

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

1. {Non-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.4
   Clone type | Type 2

   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 DefaultBoxAndWhiskerXYDataset))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.TimeTableXYDataset | org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset | SUBCLASS_TYPE_MISMATCH

   3

       if (!(obj instanceof DefaultBoxAndWhiskerXYDataset))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Conditional return true;
   2 | Conditional return true;
   3 | Conditional return false;
   4 | Conditional return false;