43-23-49

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 PieSectionEntity)) { return false; } PieSectionEntity that = (PieSectionEntity) obj; if (!ObjectUtilities.equal(this.dataset, that.dataset)) { return false; } if (this.pieIndex != that.pieIndex) { return false; } if (this.sectionIndex != that.sectionIndex) { return false; } if (!ObjectUtilities.equal(this.sectionKey, that.sectionKey)) { return false; } return super.equals(obj);

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/chart/entity/PieSectionEntity.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 14 |  | Number of AST nodes: 14

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

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            TimeTableXYDataset that = (TimeTableXYDataset) obj;↵

7

            ↵

8

            if (this.domainIsPointsInTime != that.domainIsPointsInTime↵

8

    PieSectionEntity that = (PieSectionEntity) obj;↵

9

    ) {↵

9

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

10

                return false;↵

10

                return false;↵

11

            }↵

11

            }↵

12

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

12

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

13

                return false;↵

13

                return false;↵

14

            }↵

14

            }↵

15

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

15

            if (this.↵

16

                that.workingCalendar.getTimeZone())↵

17

            ) {↵

16

    sectionIndex != that.sectionIndex) {↵

18

                return false;↵

17

                return false;↵

19

            }↵

18

            }↵

20

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

19

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

21

                return false;↵

20

                return false;↵

22

            }↵

21

            }↵

23

            return true;

22

            return super.equals(obj);

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
Number of node comparisons | 45

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.TimeTableXYDataset | org.jfree.chart.entity.PieSectionEntity | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof PieSectionEntity))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof TimeTableXYDataset does not match with type boolean of variable obj instanceof PieSectionEntity
   2 | Conditional return true;
   3 | Conditional return true;
   4 | Conditional return false;
   5 | Conditional return false;