43-10-34

if (obj == this) { return true; } if (!(obj instanceof XYAreaRenderer)) { return false; } XYAreaRenderer that = (XYAreaRenderer) obj; if (this.plotArea != that.plotArea) { return false; } if (this.plotLines != that.plotLines) { return false; } if (this.plotShapes != that.plotShapes) { return false; } if (this.showOutline != that.showOutline) { return false; } if (!ShapeUtilities.equal(this.legendArea, that.legendArea)) { 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/renderer/xy/XYAreaRenderer.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: 16 |  | 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 XYAreaRenderer)) {↵

4

            if (!(obj instanceof XYBlockRenderer)) {↵

5

                return false;   ↵

5

                return false;↵

6

            }↵

6

            }↵

7

            XYAreaRenderer that = (XYAreaRenderer) obj;↵

7

            XYBlockRenderer that = (XYBlockRenderer) obj;↵

8

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

8

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

9

                return false;   ↵

9

                return false;↵

10

            }↵

10

            }↵

11

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

11

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

12

                return false;   ↵

12

                return false;↵

13

            }↵

13

            }↵

14

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

14

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

15

                return false;   ↵

15

                return false;↵

16

            }↵

16

            }↵

17

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

17

            if (!this.↵

18

                return false;   ↵

19

            }↵

20

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

18

    paintScale.equals(that.paintScale)) {↵

21

                return false;   ↵

19

                return false;↵

22

            }↵

20

            }↵

23

            return true;

21

            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.8
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 51

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 4
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 0.5
   Clone type | Type 2

   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 XYAreaRenderer))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.XYAreaRenderer | org.jfree.chart.renderer.xy.XYBlockRenderer | SUBCLASS_TYPE_MISMATCH

   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;

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Conditional return true;
   2 | Conditional return true;
   3 | Conditional return false;
   4 | Conditional return false;