43-2-61

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 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/chart/renderer/category/ScatterRenderer.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: 20 |  | 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 ScatterRenderer)) {↵

4

            if (!(obj instanceof DefaultBoxAndWhiskerXYDataset)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            ScatterRenderer that = (ScatterRenderer↵

7

            DefaultBoxAndWhiskerXYDataset that ↵

8

    ) obj;↵

8

                    = (DefaultBoxAndWhiskerXYDataset) obj;↵

9

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

9

            if (!ObjectUtilities.equal(this.series↵

10

                    that.seriesShapesFilled)) {↵

10

    Key, that.seriesKey)) {↵

11

                return false;↵

11

                return false;↵

12

            }↵

12

            }↵

13

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

13

            if (!this.↵

14

                return false;↵

15

            }↵

16

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

17

                return false;↵

18

            }↵

19

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

20

                return false;↵

21

            }↵

22

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

14

    dates.equals(that.dates)) {↵

23

                return false;↵

15

                return false;↵

24

            }↵

16

            }↵

25

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

17

            if (!this.↵

26

                return false;↵

27

            }↵

28

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

18

    items.equals(that.items)) {↵

29

                return false;↵

19

                return false;↵

30

            }↵

20

            }↵

31

            return super.equals(obj);

21

            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.8
Clones location | Clones are in different classes
Number of node comparisons | 64

1. {Non-refactorable}

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

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.ScatterRenderer | org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   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;

   5

       DefaultBoxAndWhiskerXYDataset that = (DefaultBoxAndWhiskerXYDataset)obj;

   5

       ScatterRenderer that = (ScatterRenderer)obj;

   6

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

   6 | if (! ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled))
   6 | if (! ObjectUtilities.equal(this.seriesKey, that.seriesKey))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   seriesShapesFilled | seriesKey | VARIABLE_NAME_MISMATCH
   org.jfree.util.BooleanList | java.lang.Comparable | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.util.BooleanList of variable this.seriesShapesFilled does not match with type java.lang.Comparable of variable this.seriesKey
   - Make classes org.jfree.util.BooleanList and java.lang.Comparable extend a common superclass

   6

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

   7

       return false;

   7 | return false;
   7 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   7

       return false;

   Precondition Violations (8)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof ScatterRenderer does not match with type boolean of variable obj instanceof DefaultBoxAndWhiskerXYDataset
   2 | Type org.jfree.util.BooleanList of variable this.seriesShapesFilled does not match with type java.lang.Comparable of variable this.seriesKey
   3 | Conditional return true;
   4 | Conditional return true;
   5 | Conditional return false;
   6 | Conditional return false;
   7 | Conditional return false;
   8 | Conditional return false;