43-107-148

if (obj == this) { return true; } if (!(obj instanceof ControlPoint)) { return false; } ControlPoint that = (ControlPoint) obj; if (this.x != that.x) { return false; } /*&& y == ((ControlPoint) obj).y*/; return true;
if (obj == this) { return true; } if (!(obj instanceof XYBoxAndWhiskerRenderer)) { return false; } if (!super.equals(obj)) { return false; } XYBoxAndWhiskerRenderer that = (XYBoxAndWhiskerRenderer) obj; if (this.boxWidth != that.getBoxWidth()) { return false; } if (!PaintUtilities.equal(this.boxPaint, that.boxPaint)) { return false; } if (!PaintUtilities.equal(this.artifactPaint, that.artifactPaint)) { return false; } if (this.fillBox != that.fillBox) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYSplineRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYBoxAndWhiskerRenderer.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 9 |  | 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 ControlPoint)) {↵

4

            if (!(obj instanceof XYBoxAndWhiskerRenderer)) {↵

5

                    return false;↵

5

                return false;↵

6

            ↵

6

            }↵

7

        }↵

7

        ↵

8

                ControlPoint that = (ControlPoint↵

8

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

9

                return false;↵

10

            }↵

9

    ) obj;↵

11

            XYBoxAndWhiskerRenderer that = (XYBoxAndWhiskerRenderer) obj;↵

10

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

12

            if (this.boxWidth != that.getBoxWidth()) {↵

11

                    return false;↵

13

                return false;↵

12

            ↵

14

            }↵

13

        }↵

15

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

16

                return false;↵

14

            ↵

17

            }↵

15

        /*&& y == ((ControlPoint) obj).y*/;↵

18

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

16

        ↵

19

    {↵

20

                return false;↵

21

            }↵

22

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

23

                return false;↵

24

            }↵

17

            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) | 0.8
Clones location | Clones are in different classes
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.4
   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 ControlPoint))

   3 | if (!(obj instanceof ControlPoint))
   3 | if (!(obj instanceof XYBoxAndWhiskerRenderer))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.XYSplineRenderer.ControlPoint | org.jfree.chart.renderer.xy.XYBoxAndWhiskerRenderer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof ControlPoint does not match with type boolean of variable obj instanceof XYBoxAndWhiskerRenderer
   - Make classes org.jfree.chart.renderer.xy.XYSplineRenderer.ControlPoint and org.jfree.chart.renderer.xy.XYBoxAndWhiskerRenderer extend a common superclass

   3

       if (!(obj instanceof XYBoxAndWhiskerRenderer))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof ControlPoint does not match with type boolean of variable obj instanceof XYBoxAndWhiskerRenderer
   2 | Conditional return true;
   3 | Conditional return true;
   4 | Conditional return false;
   5 | Conditional return false;