305-2-3

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 DialTextAnnotation)) { return false; } DialTextAnnotation that = (DialTextAnnotation) obj; if (!this.label.equals(that.label)) { return false; } if (!this.font.equals(that.font)) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (this.radius != that.radius) { return false; } if (this.angle != that.angle) { return false; } if (!this.anchor.equals(that.anchor)) { return false; } return super.equals(obj);

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/plot/dial/DialTextAnnotation.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 DialTextAnnotation)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            MultiplePiePlot that = (MultiplePiePlot) obj;↵

7

            DialTextAnnotation that = (DialTextAnnotation) obj;↵

8

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

8

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

9

                return false;↵

9

                return false;↵

10

            }↵

10

            }↵

11

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

11

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

12

                return false;↵

12

                return false;↵

13

            }↵

13

            }↵

14

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

14

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

15

                return false;↵

15

                return false;↵

16

            }↵

16

            }↵

17

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

17

            if (↵

18

                    that.aggregatedItemsPaint)) {↵

18

    this.radius != that.radius) {↵

19

                return false;↵

19

                return false;↵

20

            }↵

20

            }↵

21

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

21

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

22

                return false;↵

22

                return false;↵

23

            }↵

23

            }↵

24

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

24

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

25

                return false;↵

25

                return false;↵

26

            }↵

26

            }↵

27

            return true;

27

            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) | 3.4
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 | 1
   Time elapsed for statement mapping (ms) | 2.0
   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 DialTextAnnotation))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.MultiplePiePlot | org.jfree.chart.plot.dial.DialTextAnnotation | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof DialTextAnnotation))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       DialTextAnnotation that = (DialTextAnnotation)obj;

   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)

   8 | if (this.limit != that.limit)
   12 | if (this.radius != that.radius)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   limit | radius | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.MultiplePiePlot | org.jfree.chart.plot.dial.DialTextAnnotation | VARIABLE_TYPE_MISMATCH
   limit | radius | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.MultiplePiePlot of variable that does not match with type org.jfree.chart.plot.dial.DialTextAnnotation of variable that
   - Make classes org.jfree.chart.plot.MultiplePiePlot and org.jfree.chart.plot.dial.DialTextAnnotation extend a common superclass

   12

       if (this.radius != that.radius)

   9

       return false;

   9 | return false;
   13 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   13

       return false;

   10

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

   10 | if (! this.aggregatedItemsKey.equals(that.aggregatedItemsKey))
   8 | if (! this.font.equals(that.font))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.MultiplePiePlot | org.jfree.chart.plot.dial.DialTextAnnotation | VARIABLE_TYPE_MISMATCH
   aggregatedItemsKey | font | VARIABLE_NAME_MISMATCH
   java.lang.Comparable | java.awt.Font | VARIABLE_TYPE_MISMATCH
   aggregatedItemsKey | font | VARIABLE_NAME_MISMATCH
   java.lang.Comparable | java.awt.Font | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.MultiplePiePlot of variable that does not match with type org.jfree.chart.plot.dial.DialTextAnnotation of variable that
   - Make classes org.jfree.chart.plot.MultiplePiePlot and org.jfree.chart.plot.dial.DialTextAnnotation extend a common superclass

   Type java.lang.Comparable of variable that.aggregatedItemsKey does not match with type java.awt.Font of variable that.font
   - Make classes java.lang.Comparable and java.awt.Font extend a common superclass

   Type java.lang.Comparable of variable this.aggregatedItemsKey does not match with type java.awt.Font of variable this.font
   - Make classes java.lang.Comparable and java.awt.Font extend a common superclass

   8

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

   11

       return false;

   11 | return false;
   9 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   9

       return false;

   12

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

   12 | if (! PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint))
   10 | if (! PaintUtilities.equal(this.paint, that.paint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   aggregatedItemsPaint | paint | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.MultiplePiePlot | org.jfree.chart.plot.dial.DialTextAnnotation | VARIABLE_TYPE_MISMATCH
   aggregatedItemsPaint | paint | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.MultiplePiePlot of variable that does not match with type org.jfree.chart.plot.dial.DialTextAnnotation of variable that
   - Make classes org.jfree.chart.plot.MultiplePiePlot and org.jfree.chart.plot.dial.DialTextAnnotation extend a common superclass

   10

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

   13

       return false;

   13 | return false;
   11 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   11

       return false;

   14

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

   15

       return false;

   15 | return false;

   Preondition Violations
   Unmatched return false;

   16

       if (!super.equals(obj))

   16 | if (! super.equals(obj))
   6 | if (! this.label.equals(that.label))

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

   6

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

   17

       return false;

   17 | return false;
   7 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   7

       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 DialTextAnnotation
   2 | Unmatched return false;
   3 | Type org.jfree.chart.plot.MultiplePiePlot of variable that does not match with type org.jfree.chart.plot.dial.DialTextAnnotation of variable that
   4 | Type org.jfree.chart.plot.MultiplePiePlot of variable that does not match with type org.jfree.chart.plot.dial.DialTextAnnotation of variable that
   5 | Type java.lang.Comparable of variable that.aggregatedItemsKey does not match with type java.awt.Font of variable that.font
   6 | Type java.lang.Comparable of variable this.aggregatedItemsKey does not match with type java.awt.Font of variable this.font
   7 | Type org.jfree.chart.plot.MultiplePiePlot of variable that does not match with type org.jfree.chart.plot.dial.DialTextAnnotation of variable that
   8 | Unmatched return false;
   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;