342-3-9

if (obj == this) { return true; } if (!(obj instanceof ItemLabelPosition)) { return false; } ItemLabelPosition that = (ItemLabelPosition) obj; if (!this.itemLabelAnchor.equals(that.itemLabelAnchor)) { return false; } if (!this.textAnchor.equals(that.textAnchor)) { return false; } if (!this.rotationAnchor.equals(that.rotationAnchor)) { return false; } if (this.angle != that.angle) { 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/labels/ItemLabelPosition.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: 14 |  | 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 ItemLabelPosition)) {↵

4

            if (!(obj instanceof XYBlockRenderer)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            ItemLabelPosition that = (ItemLabelPosition) obj;↵

7

            XYBlockRenderer that = (XYBlockRenderer) obj;↵

8

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

8

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

9

                return false;↵

9

                return false;↵

10

            }↵

10

            }↵

11

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

11

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

12

                return false;↵

12

                return false;↵

13

            }↵

13

            }↵

14

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

14

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

15

                return false;↵

15

                return false;↵

16

            }↵

16

            }↵

17

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

17

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

18

                return false;↵

18

                return false;↵

19

            }     ↵

19

            }↵

20

            return true;

20

            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) | 1.7
Clones location | Clones are in different classes
Number of node comparisons | 82

1. {Non-refactorable}

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

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.labels.ItemLabelPosition | org.jfree.chart.renderer.xy.XYBlockRenderer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof XYBlockRenderer))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       XYBlockRenderer that = (XYBlockRenderer)obj;

   5

       ItemLabelPosition that = (ItemLabelPosition)obj;

   8

       if (this.blockWidth != that.blockWidth)

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   6

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

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.labels.ItemLabelPosition | org.jfree.chart.renderer.xy.XYBlockRenderer | VARIABLE_TYPE_MISMATCH
   itemLabelAnchor | blockAnchor | VARIABLE_NAME_MISMATCH
   org.jfree.chart.labels.ItemLabelAnchor | org.jfree.ui.RectangleAnchor | VARIABLE_TYPE_MISMATCH
   itemLabelAnchor | blockAnchor | VARIABLE_NAME_MISMATCH
   org.jfree.chart.labels.ItemLabelAnchor | org.jfree.ui.RectangleAnchor | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   Type org.jfree.chart.labels.ItemLabelAnchor of variable that.itemLabelAnchor does not match with type org.jfree.ui.RectangleAnchor of variable that.blockAnchor
   - Make classes org.jfree.chart.labels.ItemLabelAnchor and org.jfree.ui.RectangleAnchor extend a common superclass

   Type org.jfree.chart.labels.ItemLabelAnchor of variable this.itemLabelAnchor does not match with type org.jfree.ui.RectangleAnchor of variable this.blockAnchor
   - Make classes org.jfree.chart.labels.ItemLabelAnchor and org.jfree.ui.RectangleAnchor extend a common superclass

   10

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

   7

       return false;

   7 | return false;
   11 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   11

       return false;

   8

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

   8 | if (! this.textAnchor.equals(that.textAnchor))
   12 | if (! this.paintScale.equals(that.paintScale))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.labels.ItemLabelPosition | org.jfree.chart.renderer.xy.XYBlockRenderer | VARIABLE_TYPE_MISMATCH
   textAnchor | paintScale | VARIABLE_NAME_MISMATCH
   org.jfree.ui.TextAnchor | org.jfree.chart.renderer.PaintScale | VARIABLE_TYPE_MISMATCH
   textAnchor | paintScale | VARIABLE_NAME_MISMATCH
   org.jfree.ui.TextAnchor | org.jfree.chart.renderer.PaintScale | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

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

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

   12

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

   9

       return false;

   9 | return false;
   13 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   13

       return false;

   10

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

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

       if (this.angle != that.angle)

   12 | if (this.angle != that.angle)
   6 | if (this.blockHeight != that.blockHeight)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   angle | blockHeight | VARIABLE_NAME_MISMATCH
   org.jfree.chart.labels.ItemLabelPosition | org.jfree.chart.renderer.xy.XYBlockRenderer | VARIABLE_TYPE_MISMATCH
   angle | blockHeight | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   6

       if (this.blockHeight != that.blockHeight)

   13

       return false;

   13 | 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 ItemLabelPosition does not match with type boolean of variable obj instanceof XYBlockRenderer
   2 | Unmatched return false;
   3 | Type org.jfree.chart.labels.ItemLabelPosition of variable that does not match with type org.jfree.chart.renderer.xy.XYBlockRenderer of variable that
   4 | Type org.jfree.chart.labels.ItemLabelAnchor of variable that.itemLabelAnchor does not match with type org.jfree.ui.RectangleAnchor of variable that.blockAnchor
   5 | Type org.jfree.chart.labels.ItemLabelAnchor of variable this.itemLabelAnchor does not match with type org.jfree.ui.RectangleAnchor of variable this.blockAnchor
   6 | Type org.jfree.chart.labels.ItemLabelPosition of variable that does not match with type org.jfree.chart.renderer.xy.XYBlockRenderer of variable that
   7 | Type org.jfree.ui.TextAnchor of variable that.textAnchor does not match with type org.jfree.chart.renderer.PaintScale of variable that.paintScale
   8 | Type org.jfree.ui.TextAnchor of variable this.textAnchor does not match with type org.jfree.chart.renderer.PaintScale of variable this.paintScale
   9 | Unmatched return false;
   10 | Type org.jfree.chart.labels.ItemLabelPosition of variable that does not match with type org.jfree.chart.renderer.xy.XYBlockRenderer of variable that
   11 | Conditional return true;
   12 | Conditional return true;
   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;