43-123-143

if (obj == this) { return true; } if (!(obj instanceof Day)) { return false; } Day that = (Day) obj; if (!this.serialDate.equals(that.getSerialDate())) { return false; } return true;
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/data/time/Day.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 Day↵

4

            if (!(obj instanceof BoxAndWhiskerRenderer)) {↵

5

                return false;↵

6

            }↵

5

    )) {↵

7

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

6

                return false;↵

8

                return false;↵

7

            }↵

9

            }↵

8

            Day that = (Day) obj;↵

10

            BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer) obj;↵

9

            if (!this.serialDate.equals(that.getSerialDate())↵

11

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

12

                return false;↵

13

            }↵

14

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

15

                return false;↵

16

            }↵

17

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

18

                return false;↵

19

            }↵

10

    ) {↵

20

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

11

                return false;↵

21

                return false;↵

12

            }↵

22

            }↵

13

            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) | 0.7
Clones location | Clones are in different classes
Number of node comparisons | 43

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 7
   Number of unmapped statements in the first code fragment | 1
   Number of unmapped statements in the second code fragment | 9
   Time elapsed for statement mapping (ms) | 0.7
   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 Day))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.Day | org.jfree.chart.renderer.category.BoxAndWhiskerRenderer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof Day does not match with type boolean of variable obj instanceof BoxAndWhiskerRenderer
   - Make classes org.jfree.data.time.Day and org.jfree.chart.renderer.category.BoxAndWhiskerRenderer extend a common superclass

   3

       if (!(obj instanceof BoxAndWhiskerRenderer))

   4

       return false;

   4

       return false;

   5

       Day that = (Day)obj;

   6

       if (!this.serialDate.equals(that.getSerialDate()))

   6 | if (! this.serialDate.equals(that.getSerialDate()))
   5 | if (! super.equals(obj))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   this.serialDate.equals(that.getSerialDate()) | super.equals(obj) | TYPE_COMPATIBLE_REPLACEMENT

   5

       if (!super.equals(obj))

   7

       return false;

   6

       return false;

   7

       BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer)obj;

   8

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

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   10

       if (this.fillBox != that.fillBox)

   11 | return false;

   Preondition Violations
   Unmatched 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 true;

   16

       return true;

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof Day does not match with type boolean of variable obj instanceof BoxAndWhiskerRenderer
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Unmatched return false;