43-2-21

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 XYErrorRenderer)) { return false; } XYErrorRenderer that = (XYErrorRenderer) obj; if (this.drawXError != that.drawXError) { return false; } if (this.drawYError != that.drawYError) { return false; } if (this.capLength != that.capLength) { return false; } if (!PaintUtilities.equal(this.errorPaint, that.errorPaint)) { return false; } return super.equals(obj);

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/XYErrorRenderer.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 XYErrorRenderer)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            ScatterRenderer that = (ScatterRenderer) obj;↵

7

            XYErrorRenderer that = (XYErrorRenderer) obj;↵

8

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

8

            if (↵

9

                    that.seriesShapesFilled)) {↵

10

                return false;↵

11

            }↵

12

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

13

                return false;↵

14

            }↵

15

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

9

    this.drawXError != that.drawXError) {↵

16

                return false;↵

10

                return false;↵

17

            }↵

11

            }↵

18

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

12

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

19

                return false;↵

13

                return false;↵

20

            }↵

14

            }↵

21

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

15

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

22

                return false;↵

16

                return false;↵

23

            }↵

17

            }↵

24

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

18

            if (↵

25

                return false;↵

26

            }↵

27

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

19

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

28

                return false;↵

20

                return false;↵

29

            }↵

21

            }↵

30

            return super.equals(obj);

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

1. {Non-refactorable}

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

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

   3

       if (!(obj instanceof XYErrorRenderer))

   4

       return false;

   4

       return false;

   5

       ScatterRenderer that = (ScatterRenderer)obj;

   5 | ScatterRenderer that = (ScatterRenderer)obj;
   5 | XYErrorRenderer that = (XYErrorRenderer)obj;

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

   5

       XYErrorRenderer that = (XYErrorRenderer)obj;

   6

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

   6 | if (! ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled))
   12 | if (! PaintUtilities.equal(this.errorPaint, that.errorPaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   seriesShapesFilled | errorPaint | 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.errorPaint
   - 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

   12

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

   7

       return false;

   13

       return false;

   8

       if (this.baseShapesFilled != that.baseShapesFilled)

   8 | if (this.baseShapesFilled != that.baseShapesFilled)
   8 | if (this.drawYError != that.drawYError)

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

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

   8

       if (this.drawYError != that.drawYError)

   9

       return false;

   9

       return false;

   10

       if (this.useFillPaint != that.useFillPaint)

   10 | if (this.useFillPaint != that.useFillPaint)
   6 | if (this.drawXError != that.drawXError)

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

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

   6

       if (this.drawXError != that.drawXError)

   11

       return false;

   7

       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)
   10 | if (this.capLength != that.capLength)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   itemMargin | capLength | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.category.ScatterRenderer | org.jfree.chart.renderer.xy.XYErrorRenderer | SUBCLASS_TYPE_MISMATCH
   itemMargin | capLength | VARIABLE_NAME_MISMATCH

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

   10

       if (this.capLength != that.capLength)

   19

       return false;

   11

       return false;

   20

       return super.equals(obj);

   14

       return super.equals(obj);

   Precondition Violations (12)
   Row | Violation
   --- | ---
   1 | Type org.jfree.util.BooleanList of variable this.seriesShapesFilled does not match with type java.awt.Paint of variable this.errorPaint
   2 | Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   3 | Expression that.baseShapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression that.drawYError cannot be parameterized, because it has dependencies to/from statements that will be extracted
   5 | Expression that.useFillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
   6 | Expression that.drawXError cannot be parameterized, because it has dependencies to/from statements that will be extracted
   7 | Unmatched return false;
   8 | Unmatched return false;
   9 | Unmatched return false;
   10 | Expression that.itemMargin cannot be parameterized, because it has dependencies to/from statements that will be extracted
   11 | Expression that.capLength cannot be parameterized, because it has dependencies to/from statements that will be extracted
   12 | Clone fragment #1 returns variables that , while Clone fragment #2 returns variables