43-2-86

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 PaintItem)) { return false; } PaintItem that = (PaintItem) obj; if (this.value != that.value) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { 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/chart/renderer/LookupPaintScale.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 20 |  | Number of AST nodes: 10

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

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

        PaintItem that = (PaintItem) obj;↵

13

    ) {↵

9

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

14

                return false;↵

10

                    return false;↵

15

            }↵

11

            ↵

16

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

12

        ↵

17

                return false;↵

13

    }↵

18

            }↵

14

           ↵

19

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

15

         if (↵

20

                return false;↵

21

            }↵

22

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

16

    !PaintUtilities.equal(this.paint, that.paint)) {↵

23

                return false;↵

17

        ↵

24

            }↵

25

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

26

                return false;↵

18

                return false;↵

27

            }↵

19

         ↵

28

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

20

           ↵

29

                return false;↵

30

            }↵

31

            return super.equals(obj)↵

21

    }↵

32

    ;

22

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

1. {Non-refactorable}

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

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

   1

       if (obj == this)

   1

       if (obj == this)

   2

       return true;

   2

       return true;

   3

       if (!(obj instanceof ScatterRenderer))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.ScatterRenderer | org.jfree.chart.renderer.LookupPaintScale.PaintItem | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof PaintItem))

   4

       return false;

   4

       return false;

   5

       PaintItem that = (PaintItem)obj;

   5

       ScatterRenderer that = (ScatterRenderer)obj;

   6

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

   6 | if (! ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled))
   8 | if (! PaintUtilities.equal(this.paint, that.paint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   seriesShapesFilled | paint | VARIABLE_NAME_MISMATCH
   org.jfree.util.BooleanList | java.awt.Paint | VARIABLE_TYPE_MISMATCH
   org.jfree.util.ObjectUtilities | org.jfree.util.PaintUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   - Make classes org.jfree.util.ObjectUtilities and org.jfree.util.PaintUtilities extend a common superclass

   8

       if (!PaintUtilities.equal(this.paint, that.paint))

   7

       return false;

   9

       return false;

   8

       if (this.baseShapesFilled != that.baseShapesFilled)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

       if (this.useFillPaint != that.useFillPaint)

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

       if (this.drawOutlines != that.drawOutlines)

   13

       return false;

   13 | return false;

   Preondition Violations
   Unmatched return false;

   14

       if (this.useOutlinePaint != that.useOutlinePaint)

   15

       return false;

   15 | return false;

   Preondition Violations
   Unmatched return false;

   16

       if (this.useSeriesOffset != that.useSeriesOffset)

   17

       return false;

   17 | return false;

   Preondition Violations
   Unmatched return false;

   18

       if (this.itemMargin != that.itemMargin)

   18 | if (this.itemMargin != that.itemMargin)
   6 | if (this.value != that.value)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   itemMargin | value | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.category.ScatterRenderer | org.jfree.chart.renderer.LookupPaintScale.PaintItem | VARIABLE_TYPE_MISMATCH
   itemMargin | value | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   6

       if (this.value != that.value)

   19

       return false;

   7

       return false;

   20

       return super.equals(obj);

   20 | return super.equals(obj);
   10 | return true;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   super.equals(obj) | true | TYPE_COMPATIBLE_REPLACEMENT

   10

       return true;

   Precondition Violations (9)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof ScatterRenderer does not match with type boolean of variable obj instanceof PaintItem
   2 | Type org.jfree.util.BooleanList of variable this.seriesShapesFilled does not match with type java.awt.Paint of variable this.paint
   3 | Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   4 | Unmatched return false;
   5 | Unmatched return false;
   6 | Unmatched return false;
   7 | Unmatched return false;
   8 | Unmatched return false;
   9 | Type org.jfree.chart.renderer.category.ScatterRenderer of variable that does not match with type org.jfree.chart.renderer.LookupPaintScale.PaintItem of variable that