43-125-158

if (obj == this) { return true; } if (!(obj instanceof CategoryStepRenderer)) { return false; } CategoryStepRenderer that = (CategoryStepRenderer) obj; if (this.stagger != that.stagger) { 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/category/CategoryStepRenderer.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: 8 |  | 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 CategoryStepRenderer)) {↵

7

            if (!(obj instanceof WaterfallBarRenderer)) {↵

5

                return false;↵

8

                return false;↵

6

            }↵

9

            }↵

7

            CategoryStepRenderer that = (CategoryStepRenderer) obj;↵

10

            WaterfallBarRenderer that = (WaterfallBarRenderer) obj;↵

8

            if (this.stagger !=↵

11

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

12

                return false;↵

13

            }↵

9

     that.stagger) {↵

14

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

10

                return false;↵

15

                return false;↵

11

            }↵

16

            }↵

12

            return super.equals(obj)↵

17

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

18

                    that.positiveBarPaint)) {↵

19

                return false;↵

20

            }↵

21

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

22

                    that.negativeBarPaint)) {↵

23

                return false;↵

24

            }↵

13

    ;

25

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

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.3
   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 CategoryStepRenderer))

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

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