43-16-158

if (obj == this) { return true; } if (!(obj instanceof AxisSpace)) { return false; } AxisSpace that = (AxisSpace) obj; if (this.top != that.top) { return false; } if (this.bottom != that.bottom) { return false; } if (this.left != that.left) { return false; } if (this.right != that.right) { return false; } return true;
if (obj == this) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof WaterfallBarRenderer)) { return false; } WaterfallBarRenderer that = (WaterfallBarRenderer) obj; if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint)) { return false; } if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint)) { return false; } if (!PaintUtilities.equal(this.positiveBarPaint, that.positiveBarPaint)) { return false; } if (!PaintUtilities.equal(this.negativeBarPaint, that.negativeBarPaint)) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/AxisSpace.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/WaterfallBarRenderer.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 14 |  | Number of AST nodes: 16

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof AxisSpace↵

4

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

5

                return false;↵

6

            }↵

5

    )) {↵

7

            if (!(obj instanceof WaterfallBarRenderer)) {↵

6

                return false;↵

8

                return false;↵

7

            }↵

9

            }↵

8

            AxisSpace that = (AxisSpace) obj;↵

10

            ↵

9

            if (this.top != that.top↵

11

    WaterfallBarRenderer that = (WaterfallBarRenderer) obj;↵

10

    ) {↵

12

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

11

                return false;↵

13

                return false;↵

12

            }   ↵

14

            }↵

13

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

15

            if (↵

14

                return false;↵

15

            }↵

16

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

17

                return false;↵

18

            }↵

19

            if (this.right != that.right↵

16

    !PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint)) {↵

17

                return false;↵

18

            }↵

19

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

20

                    that.positiveBarPaint)) {↵

21

                return false;↵

22

            }↵

23

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

20

    ) {↵

24

                    that.negativeBarPaint)) {↵

21

                return false;↵

25

                return false;↵

22

            }↵

26

            }↵

23

            return true;

27

            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) | 1.1
Clones location | Clones are in different classes
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.4
   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 AxisSpace))

   3 | if (!(obj instanceof AxisSpace))
   3 | if (! super.equals(obj))

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

   3

       if (!super.equals(obj))

   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;