43-106-124

if (obj == this) { return true; } if (!(obj instanceof NumberTickUnit)) { return false; } if (!super.equals(obj)) { return false; } NumberTickUnit that = (NumberTickUnit) obj; if (!this.formatter.equals(that.formatter)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof StatisticalLineAndShapeRenderer)) { return false; } StatisticalLineAndShapeRenderer that = (StatisticalLineAndShapeRenderer) obj; if (!PaintUtilities.equal(this.errorIndicatorPaint, that.errorIndicatorPaint)) { return false; } return super.equals(obj);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/NumberTickUnit.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StatisticalLineAndShapeRenderer.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 10 |  | Number of AST nodes: 8

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof NumberTickUnit)) {↵

4

            if (!(obj instanceof StatisticalLineAndShapeRenderer)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

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

7

            ↵

8

                return false;↵

8

    StatisticalLineAndShapeRenderer that↵

9

            }↵

9

            ↵

10

            NumberTickUnit that = (NumberTickUnit) obj;↵

10

            = (StatisticalLineAndShapeRenderer) obj;↵

11

            if (!this.formatter.equals(that.formatter↵

11

            if (!PaintUtilities.equal(this.errorIndicatorPaint,↵

12

    )) {↵

12

                    that.errorIndicatorPaint)) {↵

13

                return false;↵

13

                return false;↵

14

            }↵

14

            }↵

15

            return true;

15

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

1. {Non-refactorable}

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

   3 | if (!(obj instanceof NumberTickUnit))
   3 | if (!(obj instanceof StatisticalLineAndShapeRenderer))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.axis.NumberTickUnit | org.jfree.chart.renderer.category.StatisticalLineAndShapeRenderer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof NumberTickUnit does not match with type boolean of variable obj instanceof StatisticalLineAndShapeRenderer
   - Make classes org.jfree.chart.axis.NumberTickUnit and org.jfree.chart.renderer.category.StatisticalLineAndShapeRenderer extend a common superclass

   3

       if (!(obj instanceof StatisticalLineAndShapeRenderer))

   4

       return false;

   4

       return false;

   5

       StatisticalLineAndShapeRenderer that = (StatisticalLineAndShapeRenderer)obj;

   5

       if (!super.equals(obj))

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

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

   6

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

   6

       return false;

   7

       return false;

   7

       NumberTickUnit that = (NumberTickUnit)obj;

   8

       if (!this.formatter.equals(that.formatter))

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

       return true;

   10 | return true;
   8 | return super.equals(obj);

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

   8

       return super.equals(obj);

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof NumberTickUnit does not match with type boolean of variable obj instanceof StatisticalLineAndShapeRenderer
   2 | Unmatched return false;