43-118-158

if (obj == this) { return true; } if (!(obj instanceof AreaRenderer)) { return false; } AreaRenderer that = (AreaRenderer) obj; if (!this.endType.equals(that.endType)) { 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/AreaRenderer.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 AreaRenderer)) {↵

7

            if (!(obj instanceof WaterfallBarRenderer)) {↵

5

                return false;↵

8

                return false;↵

6

            }↵

9

            }↵

7

            AreaRenderer that = (AreaRenderer) obj;↵

10

            WaterfallBarRenderer that = (WaterfallBarRenderer) obj;↵

8

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

11

            if (!↵

9

                return false;↵

10

            }↵

11

            return super.equals(obj)↵

12

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

13

                return false;↵

14

            }↵

15

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

16

                return false;↵

17

            }↵

18

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

19

                    that.positiveBarPaint)) {↵

20

                return false;↵

21

            }↵

22

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

23

                    that.negativeBarPaint)) {↵

24

                return false;↵

25

            }↵

12

    ;

26

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

1. {Non-refactorable}

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

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   1

       if (obj == this)

   1

       if (obj == this)

   2

       return true;

   2

       return true;

   3

       if (!(obj instanceof AreaRenderer))

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

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

   3

       if (!super.equals(obj))

   4

       return false;

   4

       return false;

   5

       AreaRenderer that = (AreaRenderer)obj;

   5 | AreaRenderer that = (AreaRenderer)obj;
   7 | WaterfallBarRenderer that = (WaterfallBarRenderer)obj;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.AreaRenderer | org.jfree.chart.renderer.category.WaterfallBarRenderer | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.AreaRenderer | org.jfree.chart.renderer.category.WaterfallBarRenderer | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.AreaRenderer | org.jfree.chart.renderer.category.WaterfallBarRenderer | SUBCLASS_TYPE_MISMATCH

   7

       WaterfallBarRenderer that = (WaterfallBarRenderer)obj;

   6

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

   6 | if (! this.endType.equals(that.endType))
   5 | if (!(obj instanceof WaterfallBarRenderer))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   this.endType.equals(that.endType) | (obj instanceof WaterfallBarRenderer) | TYPE_COMPATIBLE_REPLACEMENT

   Preondition Violations
   Expression this.endType.equals(that.endType) cannot be parameterized, because it has dependencies to/from statements that will be extracted

   5

       if (!(obj instanceof WaterfallBarRenderer))

   7

       return false;

   6

       return false;

   8

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

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   10

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

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   12

       if (!PaintUtilities.equal(this.positiveBarPaint, that.positiveBarPaint))

   13 | return false;

   Preondition Violations
   Unmatched return false;

   13

       return false;

   14

       if (!PaintUtilities.equal(this.negativeBarPaint, that.negativeBarPaint))

   15 | return false;

   Preondition Violations
   Unmatched return false;

   15

       return false;

   8

       return super.equals(obj);

   8 | return super.equals(obj);
   16 | return true;

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

   16

       return true;

   Precondition Violations (6)
   Row | Violation
   --- | ---
   1 | Expression this.endType.equals(that.endType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Unmatched return false;
   6 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables that