43-2-23

if (obj == this) { return true; } if (!(obj instanceof ScatterRenderer)) { return false; } ScatterRenderer that = (ScatterRenderer) obj; if (!ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled)) { return false; } if (this.baseShapesFilled != that.baseShapesFilled) { return false; } if (this.useFillPaint != that.useFillPaint) { return false; } if (this.drawOutlines != that.drawOutlines) { return false; } if (this.useOutlinePaint != that.useOutlinePaint) { return false; } if (this.useSeriesOffset != that.useSeriesOffset) { return false; } if (this.itemMargin != that.itemMargin) { return false; } return super.equals(obj);
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;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/ScatterRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/time/TimeTableXYDataset.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 20 |  | 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 ScatterRenderer)) {↵

4

            if (!(obj instanceof TimeTableXYDataset)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            ScatterRenderer that = (ScatterRenderer) obj;↵

7

            ↵

8

            if (!ObjectUtilities.equal(this.seriesShapesFilled,↵

9

                    that.seriesShapesFilled)) {↵

10

                return false;↵

11

            }↵

12

            if (this.baseShapesFilled != that.baseShapesFilled↵

8

    TimeTableXYDataset that = (TimeTableXYDataset) obj;↵

13

    ) {↵

9

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

14

                return false;↵

10

                return false;↵

15

            }↵

11

            }↵

16

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

12

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

17

                return false;↵

13

                return false;↵

18

            }↵

14

            }↵

19

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

15

            if (!this.↵

20

                return false;↵

16

    workingCalendar.getTimeZone().equals(↵

21

            }↵

17

            ↵

22

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

18

        ↵

23

                return false;↵

24

            }↵

25

            if (this.useSeriesOffset != that.useSeriesOffset↵

19

    that.workingCalendar.getTimeZone())↵

26

    ) {↵

20

            ) {↵

27

                return false;↵

21

                return false;↵

28

            }↵

22

            }↵

29

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

23

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

30

                return false;↵

24

                return false;↵

31

            }↵

25

            }↵

32

            return super.equals(obj);

26

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 6
   Number of unmapped statements in the first code fragment | 3
   Number of unmapped statements in the second code fragment | 1
   Time elapsed for statement mapping (ms) | 1.1
   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 ScatterRenderer))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.ScatterRenderer | org.jfree.data.time.TimeTableXYDataset | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof TimeTableXYDataset))

   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;

   5

       ScatterRenderer that = (ScatterRenderer)obj;

   6

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

   7

       return false;

   7 | return false;

   Preondition Violations
   Unmatched return false;

   8

       if (this.baseShapesFilled != that.baseShapesFilled)

   8 | if (this.baseShapesFilled != that.baseShapesFilled)
   6 | if (this.domainIsPointsInTime != that.domainIsPointsInTime)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   baseShapesFilled | domainIsPointsInTime | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.category.ScatterRenderer | org.jfree.data.time.TimeTableXYDataset | VARIABLE_TYPE_MISMATCH
   baseShapesFilled | domainIsPointsInTime | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   6

       if (this.domainIsPointsInTime != that.domainIsPointsInTime)

   9

       return false;

   9 | return false;
   7 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   7

       return false;

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