43-2-147

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 XYDifferenceRenderer)) { return false; } if (!super.equals(obj)) { return false; } XYDifferenceRenderer that = (XYDifferenceRenderer) obj; if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) { return false; } if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) { return false; } if (this.shapesVisible != that.shapesVisible) { return false; } if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } if (this.roundXCoordinates != that.roundXCoordinates) { 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/xy/XYDifferenceRenderer.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 20 |  | Number of AST nodes: 18

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

5

                return false;↵

5

                return false;   ↵

6

            }↵

6

            }↵

7

            ScatterRenderer that = (ScatterRenderer) obj;↵

7

            ↵

8

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

9

                    that.seriesShapesFilled)) {↵

8

    if (!super.equals(obj)) {↵

10

                return false;↵

9

                return false;   ↵

11

            }↵

10

            }↵

12

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

11

            ↵

13

                return false;↵

14

            }↵

15

            if (this.useFill↵

12

    XYDifferenceRenderer that = (XYDifferenceRenderer) obj;↵

16

    Paint != that.useFillPaint) {↵

13

            if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) {↵

17

                return false;↵

14

                return false;   ↵

18

            }↵

15

            }↵

19

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

16

            if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) {↵

20

                return false;↵

17

                return false;   ↵

21

            }↵

18

            }↵

22

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

19

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

23

                return false;↵

20

                return false;   ↵

24

            }↵

21

            }↵

25

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

22

            if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) {↵

26

                return false;↵

23

                return false;   ↵

27

            }↵

24

            }↵

28

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

25

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

29

                return false;↵

26

                return false;↵

30

            }↵

27

            }↵

31

            return super.equals(obj);

28

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

1. {Non-refactorable}

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.ScatterRenderer | org.jfree.chart.renderer.xy.XYDifferenceRenderer | SUBCLASS_TYPE_MISMATCH

   3

       if (!(obj instanceof XYDifferenceRenderer))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       ScatterRenderer that = (ScatterRenderer)obj;

   5 | ScatterRenderer that = (ScatterRenderer)obj;
   7 | XYDifferenceRenderer that = (XYDifferenceRenderer)obj;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.ScatterRenderer | org.jfree.chart.renderer.xy.XYDifferenceRenderer | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.ScatterRenderer | org.jfree.chart.renderer.xy.XYDifferenceRenderer | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.ScatterRenderer | org.jfree.chart.renderer.xy.XYDifferenceRenderer | SUBCLASS_TYPE_MISMATCH

   7

       XYDifferenceRenderer that = (XYDifferenceRenderer)obj;

   6

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

   6 | if (! ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled))
   5 | if (! super.equals(obj))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   ObjectUtilities.equal(this.seriesShapesFilled,that.seriesShapesFilled) | super.equals(obj) | TYPE_COMPATIBLE_REPLACEMENT

   Preondition Violations
   Expression ObjectUtilities.equal(this.seriesShapesFilled,that.seriesShapesFilled) cannot be parameterized, because it has dependencies to/from statements that will be extracted

   5

       if (!super.equals(obj))

   7

       return false;

   7 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

   8

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

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   10

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

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   8

       if (this.baseShapesFilled != that.baseShapesFilled)

   8 | if (this.baseShapesFilled != that.baseShapesFilled)
   12 | if (this.shapesVisible != that.shapesVisible)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   baseShapesFilled | shapesVisible | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.category.ScatterRenderer | org.jfree.chart.renderer.xy.XYDifferenceRenderer | SUBCLASS_TYPE_MISMATCH
   baseShapesFilled | shapesVisible | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression that.baseShapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression that.shapesVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted

   12

       if (this.shapesVisible != that.shapesVisible)

   9

       return false;

   9 | return false;
   13 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   13

       return false;

   14

       if (!ShapeUtilities.equal(this.legendLine, that.legendLine))

   15 | return false;

   Preondition Violations
   Unmatched return false;

   15

       return false;

   10

       if (this.useFillPaint != that.useFillPaint)

   10 | if (this.useFillPaint != that.useFillPaint)
   16 | if (this.roundXCoordinates != that.roundXCoordinates)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   useFillPaint | roundXCoordinates | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.category.ScatterRenderer | org.jfree.chart.renderer.xy.XYDifferenceRenderer | SUBCLASS_TYPE_MISMATCH
   useFillPaint | roundXCoordinates | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression that.useFillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression that.roundXCoordinates cannot be parameterized, because it has dependencies to/from statements that will be extracted

   16

       if (this.roundXCoordinates != that.roundXCoordinates)

   11

       return false;

   11 | return false;
   17 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   17

       return false;

   Precondition Violations (19)
   Row | Violation
   --- | ---
   1 | Expression ObjectUtilities.equal(this.seriesShapesFilled,that.seriesShapesFilled) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Expression that.baseShapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
   5 | Expression that.shapesVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
   6 | Unmatched return false;
   7 | Expression that.useFillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
   8 | Expression that.roundXCoordinates cannot be parameterized, because it has dependencies to/from statements that will be extracted
   9 | Clone fragment #1 returns variable that with type org.jfree.chart.renderer.category.ScatterRenderer , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.xy.XYDifferenceRenderer
   10 | Conditional return true;
   11 | Conditional return true;
   12 | Conditional return false;
   13 | Conditional return false;
   14 | Conditional return false;
   15 | Conditional return false;
   16 | Conditional return false;
   17 | Conditional return false;
   18 | Conditional return false;
   19 | Conditional return false;