305-2-5

if (obj == this) { return true; } if (!(obj instanceof MultiplePiePlot)) { return false; } MultiplePiePlot that = (MultiplePiePlot) obj; if (this.dataExtractOrder != that.dataExtractOrder) { return false; } if (this.limit != that.limit) { return false; } if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey)) { return false; } if (!PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint)) { return false; } if (!ObjectUtilities.equal(this.pieChart, that.pieChart)) { return false; } if (!super.equals(obj)) { return false; } return true;
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/plot/MultiplePiePlot.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: 18 |  | 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 MultiplePiePlot)) {↵

4

            if (!(obj instanceof XYDifferenceRenderer)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

7

            MultiplePiePlot that = (MultiplePiePlot) obj;↵

8

            if (this.dataExtractOrder != that.dataExtractOrder↵

6

       ↵

7

            }↵

9

    ) {↵

8

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

10

                return false;↵

9

                return false;   ↵

11

            }↵

10

            }↵

12

            if (this.limit != that.limit↵

11

            XYDifferenceRenderer that = (XYDifferenceRenderer) obj;↵

13

    ) {↵

12

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

14

                return false;↵

13

                return false;   ↵

15

            }↵

14

            }↵

16

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

15

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

17

                return false;↵

16

                return false;   ↵

18

            }↵

17

            }↵

19

            if (!PaintUtilities.equal(this.aggregatedItemsPaint,↵

18

            if (↵

20

                    that.aggregatedItemsPaint)) {↵

19

    this.shapesVisible != that.shapesVisible) {↵

21

                return false;↵

20

                return false;   ↵

22

            }↵

21

            }↵

23

            if (!ObjectUtilities.equal(this.pieChart, that.pieChart)) {↵

22

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

24

                return false;↵

23

                return false;   ↵

25

            }↵

24

            }↵

26

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

25

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

27

                return false;↵

26

                return false;↵

28

            }↵

27

            }↵

29

            return true;

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 12
   Number of unmapped statements in the first code fragment | 5
   Number of unmapped statements in the second code fragment | 3
   Time elapsed for statement mapping (ms) | 1.9
   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 MultiplePiePlot))

   3 | if (!(obj instanceof MultiplePiePlot))
   3 | if (!(obj instanceof XYDifferenceRenderer))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.MultiplePiePlot | org.jfree.chart.renderer.xy.XYDifferenceRenderer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof MultiplePiePlot does not match with type boolean of variable obj instanceof XYDifferenceRenderer
   - Make classes org.jfree.chart.plot.MultiplePiePlot and org.jfree.chart.renderer.xy.XYDifferenceRenderer extend a common superclass

   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

       MultiplePiePlot that = (MultiplePiePlot)obj;

   6

       if (this.dataExtractOrder != that.dataExtractOrder)

   7

       return false;

   7 | return false;

   Preondition Violations
   Unmatched return false;

   8

       if (this.limit != that.limit)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

       if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey))

   10 | if (! this.aggregatedItemsKey.equals(that.aggregatedItemsKey))
   5 | if (! super.equals(obj))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   this.aggregatedItemsKey.equals(that.aggregatedItemsKey) | super.equals(obj) | TYPE_COMPATIBLE_REPLACEMENT

   5

       if (!super.equals(obj))

   11

       return false;

   11 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

   7

       XYDifferenceRenderer that = (XYDifferenceRenderer)obj;

   12

       if (this.shapesVisible != that.shapesVisible)

   13 | return false;

   Preondition Violations
   Unmatched return false;

   13

       return false;

   12

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

   12 | if (! PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint))
   14 | if (! ShapeUtilities.equal(this.legendLine, that.legendLine))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   aggregatedItemsPaint | legendLine | VARIABLE_NAME_MISMATCH
   java.awt.Paint | java.awt.Shape | VARIABLE_TYPE_MISMATCH
   org.jfree.util.PaintUtilities | org.jfree.util.ShapeUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.awt.Paint of variable this.aggregatedItemsPaint does not match with type java.awt.Shape of variable this.legendLine
   - Make classes java.awt.Paint and java.awt.Shape extend a common superclass

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

   14

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

   13

       return false;

   13 | return false;
   15 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   15

       return false;

   14

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

   14 | if (! ObjectUtilities.equal(this.pieChart, that.pieChart))
   10 | if (! PaintUtilities.equal(this.negativePaint, that.negativePaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   pieChart | negativePaint | VARIABLE_NAME_MISMATCH
   org.jfree.chart.JFreeChart | java.awt.Paint | VARIABLE_TYPE_MISMATCH
   org.jfree.util.ObjectUtilities | org.jfree.util.PaintUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.JFreeChart of variable this.pieChart does not match with type java.awt.Paint of variable this.negativePaint
   - Make classes org.jfree.chart.JFreeChart 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

   10

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

   15

       return false;

   15 | return false;
   11 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   11

       return false;

   16

       if (!super.equals(obj))

   16 | if (! super.equals(obj))
   8 | if (! PaintUtilities.equal(this.positivePaint, that.positivePaint))

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

   8

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

   17

       return false;

   17 | return false;
   9 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   9

       return false;

   Precondition Violations (20)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof MultiplePiePlot does not match with type boolean of variable obj instanceof XYDifferenceRenderer
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Type java.awt.Paint of variable this.aggregatedItemsPaint does not match with type java.awt.Shape of variable this.legendLine
   6 | Type org.jfree.util.PaintUtilities of variable PaintUtilities does not match with type org.jfree.util.ShapeUtilities of variable ShapeUtilities
   7 | Type org.jfree.chart.JFreeChart of variable this.pieChart does not match with type java.awt.Paint of variable this.negativePaint
   8 | Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   9 | Conditional return true;
   10 | Conditional return true;
   11 | Conditional return false;
   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;
   20 | Conditional return false;