292-4-5

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 (!(obj instanceof GanttRenderer)) { return false; } GanttRenderer that = (GanttRenderer) obj; if (!PaintUtilities.equal(this.completePaint, that.completePaint)) { return false; } if (!PaintUtilities.equal(this.incompletePaint, that.incompletePaint)) { return false; } if (this.startPercent != that.startPercent) { return false; } if (this.endPercent != that.endPercent) { return false; } return super.equals(obj);

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/GanttRenderer.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 16 |  | Number of AST nodes: 14

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof BoxAndWhiskerRenderer)) {↵

4

            if (!(obj instanceof GanttRenderer)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

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

7

            ↵

8

                return false;↵

9

            }↵

10

            BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer) obj;↵

8

    GanttRenderer that = (GanttRenderer) obj;↵

11

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

9

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

12

                return false;↵

10

                return false;↵

13

            }↵

11

            }↵

14

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

12

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

15

                return false;↵

13

                return false;↵

16

            }↵

14

            }↵

17

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

15

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

18

                return false;↵

16

                return false;↵

19

            }↵

17

            }↵

20

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

18

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

21

                return false;↵

19

                return false;↵

22

            }↵

20

            }↵

23

            return true;

21

            return super.equals(obj);

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 14
   Number of unmapped statements in the first code fragment | 2
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 2.3
   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 BoxAndWhiskerRenderer))

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

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

   3

       if (!(obj instanceof GanttRenderer))

   4

       return false;

   4

       return false;

   5

       if (!super.equals(obj))

   5 | if (! super.equals(obj))
   6 | if (! PaintUtilities.equal(this.completePaint, that.completePaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   super.equals(obj) | PaintUtilities.equal(this.completePaint,that.completePaint) | TYPE_COMPATIBLE_REPLACEMENT

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

   6

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

   6

       return false;

   7

       return false;

   7

       BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer)obj;

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

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

   5

       GanttRenderer that = (GanttRenderer)obj;

   8

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

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

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

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

   8

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

   9

       return false;

   9

       return false;

   10

       if (this.fillBox != that.fillBox)

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

       if (this.itemMargin != that.itemMargin)

   12 | if (this.itemMargin != that.itemMargin)
   12 | if (this.endPercent != that.endPercent)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   itemMargin | endPercent | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.category.BoxAndWhiskerRenderer | org.jfree.chart.renderer.category.GanttRenderer | SUBCLASS_TYPE_MISMATCH
   itemMargin | endPercent | VARIABLE_NAME_MISMATCH

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

   12

       if (this.endPercent != that.endPercent)

   13

       return false;

   13

       return false;

   14

       if (this.maximumBarWidth != that.maximumBarWidth)

   14 | if (this.maximumBarWidth != that.maximumBarWidth)
   10 | if (this.startPercent != that.startPercent)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   maximumBarWidth | startPercent | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.category.BoxAndWhiskerRenderer | org.jfree.chart.renderer.category.GanttRenderer | SUBCLASS_TYPE_MISMATCH
   maximumBarWidth | startPercent | VARIABLE_NAME_MISMATCH

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

   10

       if (this.startPercent != that.startPercent)

   15

       return false;

   11

       return false;

   16

       return true;

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

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

   14

       return super.equals(obj);

   Precondition Violations (9)
   Row | Violation
   --- | ---
   1 | Expression PaintUtilities.equal(this.completePaint,that.completePaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression that.artifactPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression that.incompletePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Unmatched return false;
   5 | Expression that.itemMargin cannot be parameterized, because it has dependencies to/from statements that will be extracted
   6 | Expression that.endPercent cannot be parameterized, because it has dependencies to/from statements that will be extracted
   7 | Expression that.maximumBarWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
   8 | Expression that.startPercent cannot be parameterized, because it has dependencies to/from statements that will be extracted
   9 | Clone fragment #1 returns variables that , while Clone fragment #2 returns variables