43-11-158

if (obj == this) { return true; } if (!(obj instanceof XYStepAreaRenderer)) { return false; } XYStepAreaRenderer that = (XYStepAreaRenderer) obj; if (this.showOutline != that.showOutline) { return false; } if (this.shapesVisible != that.shapesVisible) { return false; } if (this.shapesFilled != that.shapesFilled) { return false; } if (this.plotArea != that.plotArea) { return false; } if (this.rangeBase != that.rangeBase) { return false; } return super.equals(obj);
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/renderer/xy/XYStepAreaRenderer.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: 16 |  | Number of AST nodes: 16

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

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

5

                return false;↵

6

            }↵

4

            if (!(obj instanceof XYStepAreaRenderer)) {↵

7

            if (!(obj instanceof WaterfallBarRenderer)) {↵

5

                return false;↵

8

                return false;↵

6

            }↵

9

            }↵

7

            XYStepAreaRenderer that = (XYStepAreaRenderer) obj;↵

10

            WaterfallBarRenderer that = (WaterfallBarRenderer) obj;↵

8

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

11

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

9

                return false;↵

12

                return false;↵

10

            }↵

13

            }↵

11

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

14

            if (↵

12

                return false;↵

13

            }↵

14

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

15

                return false;↵

15

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

16

                return false;↵

17

            }↵

18

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

16

            }↵

19

            ↵

17

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

20

            that.positiveBarPaint)) {↵

18

                return false;↵

21

                return false;↵

19

            }↵

22

            }↵

20

            if (this.rangeBase != that.rangeBase↵

23

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

21

    ) {↵

24

                    that.negativeBarPaint)) {↵

22

                return false;↵

25

                return false;↵

23

            }↵

26

            }↵

24

            return super.equals(obj);

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) | 2.0
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 58

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.7
   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 XYStepAreaRenderer))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   (obj instanceof XYStepAreaRenderer) | 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;