43-148-149

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;
if (obj == this) { return true; } if (!(obj instanceof Title)) { return false; } if (!super.equals(obj)) { return false; } Title that = (Title) obj; if (this.position != that.position) { return false; } if (this.horizontalAlignment != that.horizontalAlignment) { return false; } if (this.verticalAlignment != that.verticalAlignment) { return false; } if (this.notify != that.notify) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYBoxAndWhiskerRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/title/Title.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 XYBoxAndWhiskerRenderer)) {↵

4

            if (!(obj instanceof Title)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

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

7

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

8

                return false;↵

8

                return false;   ↵

9

            }↵

9

            }↵

10

            XYBoxAndWhiskerRenderer that = (XYBoxAndWhiskerRenderer) obj;↵

10

            Title that = (Title) obj;↵

11

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

11

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

12

                return false;↵

12

                return false;↵

13

            }↵

13

            }↵

14

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

14

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

15

                return false;↵

15

                return false;↵

16

            }↵

16

            }↵

17

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

17

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

18

                return false;↵

18

                return false;↵

19

            }↵

19

            }↵

20

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

20

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

21

                return false;↵

21

                return false;↵

22

            }↵

22

            }↵

23

            return true;

23

            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.7
Clones location | Clones are in different classes
Number of node comparisons | 80

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 8
   Number of unmapped statements in the first code fragment | 7
   Number of unmapped statements in the second code fragment | 7
   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;
   2 | return true;

   Preondition Violations
   Conditional return true;
   Conditional return true;

   2

       return true;

   3

       if (!(obj instanceof XYBoxAndWhiskerRenderer))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.XYBoxAndWhiskerRenderer | org.jfree.chart.title.Title | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof Title))

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

   6

       return false;

   6 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

   7

       Title that = (Title)obj;

   7

       XYBoxAndWhiskerRenderer that = (XYBoxAndWhiskerRenderer)obj;

   8

       if (this.position != that.position)

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   8

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

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

       if (this.horizontalAlignment != that.horizontalAlignment)

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   10

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

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

       if (this.verticalAlignment != that.verticalAlignment)

   13 | return false;

   Preondition Violations
   Unmatched return false;

   13

       return false;

   12

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

   13

       return false;

   13 | return false;

   Preondition Violations
   Unmatched return false;

   14

       if (this.fillBox != that.fillBox)

   14 | if (this.fillBox != that.fillBox)
   14 | if (this.notify != that.notify)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   fillBox | notify | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.xy.XYBoxAndWhiskerRenderer | org.jfree.chart.title.Title | VARIABLE_TYPE_MISMATCH
   fillBox | notify | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.renderer.xy.XYBoxAndWhiskerRenderer of variable that does not match with type org.jfree.chart.title.Title of variable that
   - Make classes org.jfree.chart.renderer.xy.XYBoxAndWhiskerRenderer and org.jfree.chart.title.Title extend a common superclass

   14

       if (this.notify != that.notify)

   15

       return false;

   15 | return false;
   15 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   15

       return false;

   Precondition Violations (16)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof XYBoxAndWhiskerRenderer does not match with type boolean of variable obj instanceof Title
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Unmatched return false;
   6 | Unmatched return false;
   7 | Unmatched return false;
   8 | Type org.jfree.chart.renderer.xy.XYBoxAndWhiskerRenderer of variable that does not match with type org.jfree.chart.title.Title of variable that
   9 | Conditional return true;
   10 | Conditional return true;
   11 | Conditional return false;
   12 | Conditional return false;
   13 | Conditional return false;
   14 | Conditional return false;
   15 | Conditional return false;
   16 | Conditional return false;