43-125-143

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 (!(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;

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/BoxAndWhiskerRenderer.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 (!(obj instanceof CategoryStepRenderer)) {↵

4

            if (!(obj instanceof BoxAndWhiskerRenderer)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            CategoryStep↵

7

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

8

                return false;↵

9

            }↵

8

    Renderer that = (CategoryStepRenderer) obj;↵

10

            BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer) obj;↵

9

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

11

            if (↵

10

                return false;↵

11

            }↵

12

            return super.equals(obj)↵

12

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

13

                return false;↵

14

            }↵

15

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

16

                return false;↵

17

            }↵

18

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

19

                return false;↵

20

            }↵

21

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

22

                return false;↵

23

            }↵

13

    ;

24

            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) | 0.9
   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 CategoryStepRenderer))

   3 | if (!(obj instanceof CategoryStepRenderer))
   3 | if (!(obj instanceof BoxAndWhiskerRenderer))

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

   3

       if (!(obj instanceof BoxAndWhiskerRenderer))

   4

       return false;

   4

       return false;

   5

       if (!super.equals(obj))

   6 | return false;

   Preondition Violations
   Unmatched return false;

   6

       return false;

   5

       CategoryStepRenderer that = (CategoryStepRenderer)obj;

   5 | CategoryStepRenderer that = (CategoryStepRenderer)obj;
   7 | BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer)obj;

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

   7

       BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer)obj;

   8

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

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   6

       if (this.stagger != that.stagger)

   6 | if (this.stagger != that.stagger)
   10 | if (this.fillBox != that.fillBox)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   stagger | fillBox | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.category.CategoryStepRenderer | org.jfree.chart.renderer.category.BoxAndWhiskerRenderer | SUBCLASS_TYPE_MISMATCH
   stagger | fillBox | VARIABLE_NAME_MISMATCH

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

   10

       if (this.fillBox != that.fillBox)

   7

       return false;

   11

       return false;

   12

       if (this.itemMargin != that.itemMargin)

   13 | return false;

   Preondition Violations
   Unmatched return false;

   13

       return false;

   14

       if (this.maximumBarWidth != that.maximumBarWidth)

   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 (7)
   Row | Violation
   --- | ---
   1 | Unmatched return false;
   2 | Unmatched return false;
   3 | Expression that.stagger cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression that.fillBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
   5 | Unmatched return false;
   6 | Unmatched return false;
   7 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables that