43-1-34

if (obj == this) { return true; } if (!(obj instanceof PieLabelRecord)) { return false; } PieLabelRecord that = (PieLabelRecord) obj; if (!this.key.equals(that.key)) { return false; } if (this.angle != that.angle) { return false; } if (this.gap != that.gap) { return false; } if (this.allocatedY != that.allocatedY) { return false; } if (this.baseY != that.baseY) { return false; } if (this.labelHeight != that.labelHeight) { return false; } if (this.linkPercent != that.linkPercent) { return false; } if (!this.label.equals(that.label)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof XYBlockRenderer)) { return false; } XYBlockRenderer that = (XYBlockRenderer) obj; if (this.blockHeight != that.blockHeight) { return false; } if (this.blockWidth != that.blockWidth) { return false; } if (!this.blockAnchor.equals(that.blockAnchor)) { return false; } if (!this.paintScale.equals(that.paintScale)) { return false; } return super.equals(obj);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PieLabelRecord.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYBlockRenderer.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 22 |  | 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 PieLabelRecord)) {↵

4

            if (!(obj instanceof XYBlockRenderer)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            PieLabelRecord that = (PieLabelRecord) obj;↵

7

            XYBlockRenderer that = (XYBlockRenderer) obj;↵

8

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

8

            if (this.↵

9

                return false;↵

10

            }↵

11

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

12

                return false;↵

13

            }↵

14

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

9

    blockHeight != that.blockHeight) {↵

15

                return false;↵

10

                return false;↵

16

            }↵

11

            }↵

17

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

12

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

18

                return false;↵

13

                return false;↵

19

            }↵

14

            }↵

20

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

15

            if (!this.b↵

21

                return false;↵

22

            }↵

23

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

16

    lockAnchor.equals(that.blockAnchor)) {↵

24

                return false;↵

17

                return false;↵

25

            }↵

18

            }↵

26

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

19

            if (!this.↵

27

                return false;↵

28

            }↵

29

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

20

    paintScale.equals(that.paintScale)) {↵

30

                return false;↵

21

                return false;↵

31

            }↵

22

            }↵

32

            return true;

23

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 13
   Number of unmapped statements in the first code fragment | 9
   Number of unmapped statements in the second code fragment | 1
   Time elapsed for statement mapping (ms) | 2.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;

   3

       if (!(obj instanceof PieLabelRecord))

   3 | if (!(obj instanceof PieLabelRecord))
   3 | if (!(obj instanceof XYBlockRenderer))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.PieLabelRecord | org.jfree.chart.renderer.xy.XYBlockRenderer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof XYBlockRenderer))

   4

       return false;

   4

       return false;

   5

       XYBlockRenderer that = (XYBlockRenderer)obj;

   5

       PieLabelRecord that = (PieLabelRecord)obj;

   6

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

   6 | if (! this.key.equals(that.key))
   10 | if (! this.blockAnchor.equals(that.blockAnchor))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.PieLabelRecord | org.jfree.chart.renderer.xy.XYBlockRenderer | VARIABLE_TYPE_MISMATCH
   key | blockAnchor | VARIABLE_NAME_MISMATCH
   java.lang.Comparable | org.jfree.ui.RectangleAnchor | VARIABLE_TYPE_MISMATCH
   key | blockAnchor | VARIABLE_NAME_MISMATCH
   java.lang.Comparable | org.jfree.ui.RectangleAnchor | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.renderer.xy.XYBlockRenderer of variable that
   - Make classes org.jfree.chart.plot.PieLabelRecord and org.jfree.chart.renderer.xy.XYBlockRenderer extend a common superclass

   Type java.lang.Comparable of variable that.key does not match with type org.jfree.ui.RectangleAnchor of variable that.blockAnchor
   - Make classes java.lang.Comparable and org.jfree.ui.RectangleAnchor extend a common superclass

   Type java.lang.Comparable of variable this.key does not match with type org.jfree.ui.RectangleAnchor of variable this.blockAnchor
   - Make classes java.lang.Comparable and org.jfree.ui.RectangleAnchor extend a common superclass

   10

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

   7

       return false;

   11

       return false;

   8

       if (this.angle != that.angle)

   8 | if (this.angle != that.angle)
   8 | if (this.blockWidth != that.blockWidth)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   angle | blockWidth | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.PieLabelRecord | org.jfree.chart.renderer.xy.XYBlockRenderer | VARIABLE_TYPE_MISMATCH
   angle | blockWidth | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.renderer.xy.XYBlockRenderer of variable that
   - Make classes org.jfree.chart.plot.PieLabelRecord and org.jfree.chart.renderer.xy.XYBlockRenderer extend a common superclass

   8

       if (this.blockWidth != that.blockWidth)

   9

       return false;

   9

       return false;

   10

       if (this.gap != that.gap)

   10 | if (this.gap != that.gap)
   6 | if (this.blockHeight != that.blockHeight)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   gap | blockHeight | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.PieLabelRecord | org.jfree.chart.renderer.xy.XYBlockRenderer | VARIABLE_TYPE_MISMATCH
   gap | blockHeight | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.renderer.xy.XYBlockRenderer of variable that
   - Make classes org.jfree.chart.plot.PieLabelRecord and org.jfree.chart.renderer.xy.XYBlockRenderer extend a common superclass

   6

       if (this.blockHeight != that.blockHeight)

   11

       return false;

   7

       return false;

   12

       if (this.allocatedY != that.allocatedY)

   13

       return false;

   13 | return false;

   Preondition Violations
   Unmatched return false;

   14

       if (this.baseY != that.baseY)

   15

       return false;

   15 | return false;

   Preondition Violations
   Unmatched return false;

   16

       if (this.labelHeight != that.labelHeight)

   17

       return false;

   17 | return false;

   Preondition Violations
   Unmatched return false;

   18

       if (this.linkPercent != that.linkPercent)

   19

       return false;

   19 | return false;

   Preondition Violations
   Unmatched return false;

   20

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

   20 | if (! this.label.equals(that.label))
   12 | if (! this.paintScale.equals(that.paintScale))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.PieLabelRecord | org.jfree.chart.renderer.xy.XYBlockRenderer | VARIABLE_TYPE_MISMATCH
   label | paintScale | VARIABLE_NAME_MISMATCH
   org.jfree.text.TextBox | org.jfree.chart.renderer.PaintScale | VARIABLE_TYPE_MISMATCH
   label | paintScale | VARIABLE_NAME_MISMATCH
   org.jfree.text.TextBox | org.jfree.chart.renderer.PaintScale | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.renderer.xy.XYBlockRenderer of variable that
   - Make classes org.jfree.chart.plot.PieLabelRecord and org.jfree.chart.renderer.xy.XYBlockRenderer extend a common superclass

   Type org.jfree.text.TextBox of variable that.label does not match with type org.jfree.chart.renderer.PaintScale of variable that.paintScale
   - Make classes org.jfree.text.TextBox and org.jfree.chart.renderer.PaintScale extend a common superclass

   Type org.jfree.text.TextBox of variable this.label does not match with type org.jfree.chart.renderer.PaintScale of variable this.paintScale
   - Make classes org.jfree.text.TextBox and org.jfree.chart.renderer.PaintScale extend a common superclass

   12

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

   21

       return false;

   13

       return false;

   22

       return true;

   22 | return true;
   14 | return super.equals(obj);

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

   14

       return super.equals(obj);

   Precondition Violations (13)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof PieLabelRecord does not match with type boolean of variable obj instanceof XYBlockRenderer
   2 | Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.renderer.xy.XYBlockRenderer of variable that
   3 | Type java.lang.Comparable of variable that.key does not match with type org.jfree.ui.RectangleAnchor of variable that.blockAnchor
   4 | Type java.lang.Comparable of variable this.key does not match with type org.jfree.ui.RectangleAnchor of variable this.blockAnchor
   5 | Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.renderer.xy.XYBlockRenderer of variable that
   6 | Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.renderer.xy.XYBlockRenderer of variable that
   7 | Unmatched return false;
   8 | Unmatched return false;
   9 | Unmatched return false;
   10 | Unmatched return false;
   11 | Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.renderer.xy.XYBlockRenderer of variable that
   12 | Type org.jfree.text.TextBox of variable that.label does not match with type org.jfree.chart.renderer.PaintScale of variable that.paintScale
   13 | Type org.jfree.text.TextBox of variable this.label does not match with type org.jfree.chart.renderer.PaintScale of variable this.paintScale