43-143-158

if (obj == this) { return true; } if (!(obj instanceof BoxAndWhiskerRenderer)) { return false; } if (!super.equals(obj)) { return false; } BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer) obj; if (!PaintUtilities.equal(this.artifactPaint, that.artifactPaint)) { return false; } if (this.fillBox != that.fillBox) { return false; } if (this.itemMargin != that.itemMargin) { return false; } if (this.maximumBarWidth != that.maximumBarWidth) { 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/renderer/category/BoxAndWhiskerRenderer.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 (!(obj instanceof BoxAndWhiskerRenderer)) {↵

4

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

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

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

7

            if (!(obj instanceof WaterfallBarRenderer)) {↵

8

                return false;↵

8

                return false;↵

9

            }↵

9

            }↵

10

            BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer) obj;↵

10

            WaterfallBarRenderer that = (WaterfallBarRenderer) obj;↵

11

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

11

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

12

                return false;↵

12

                return false;↵

13

            }↵

13

            }↵

14

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

14

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

15

                return false;↵

15

                return false;↵

16

            }↵

16

            }↵

17

            if (this.itemMargin != that.itemMargin↵

17

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

18

    ) {↵

18

                    that.positiveBarPaint)) {↵

19

                return false;↵

19

                return false;↵

20

            }↵

20

            }↵

21

            if (this.maximumBarWidth != that.maximumBarWidth↵

21

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

22

    ) {↵

22

                    that.negativeBarPaint)) {↵

23

                return false;↵

23

                return false;↵

24

            }↵

24

            }↵

25

            return true;

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 9
   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) | 1.0
   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 BoxAndWhiskerRenderer))

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

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

   5

       if (!super.equals(obj))

   5 | if (! super.equals(obj))
   5 | if (!(obj instanceof WaterfallBarRenderer))

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

   5

       if (!(obj instanceof WaterfallBarRenderer))

   6

       return false;

   6 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

   7

       BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer)obj;

   7 | BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer)obj;
   7 | WaterfallBarRenderer that = (WaterfallBarRenderer)obj;

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

   7

       WaterfallBarRenderer that = (WaterfallBarRenderer)obj;

   8

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

   8 | if (! PaintUtilities.equal(this.artifactPaint, that.artifactPaint))
   8 | if (! PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   artifactPaint | firstBarPaint | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.category.BoxAndWhiskerRenderer | org.jfree.chart.renderer.category.WaterfallBarRenderer | SUBCLASS_TYPE_MISMATCH
   artifactPaint | firstBarPaint | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression that.artifactPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression that.firstBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted

   8

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

   9

       return false;

   9 | return false;
   9 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   9

       return false;

   Precondition Violations (11)
   Row | Violation
   --- | ---
   1 | Expression that.artifactPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression that.firstBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Clone fragment #1 returns variable that with type org.jfree.chart.renderer.category.BoxAndWhiskerRenderer , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.category.WaterfallBarRenderer
   4 | Conditional return true;
   5 | Conditional return true;
   6 | Conditional return false;
   7 | Conditional return false;
   8 | Conditional return false;
   9 | Conditional return false;
   10 | Conditional return false;
   11 | Conditional return false;