43-101-145

if (obj == this) { return true; } if (!(obj instanceof LevelRenderer)) { return false; } LevelRenderer that = (LevelRenderer) obj; if (this.itemMargin != that.itemMargin) { return false; } if (this.maxItemWidth != that.maxItemWidth) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof IntervalMarker)) { return false; } if (!super.equals(obj)) { return false; } IntervalMarker that = (IntervalMarker) obj; if (this.startValue != that.startValue) { return false; } if (this.endValue != that.endValue) { return false; } if (!ObjectUtilities.equal(this.gradientPaintTransformer, that.gradientPaintTransformer)) { return false; } return true;

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

4

            if (!(obj instanceof IntervalMarker)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            LevelRenderer that = (LevelRender↵

7

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

8

                return false;↵

9

            }↵

8

    er) obj;↵

10

            IntervalMarker that = (IntervalMarker) obj;↵

9

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

11

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

10

                return false;↵

12

                return false;   ↵

11

            }↵

13

            }↵

12

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

14

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

13

                return false;↵

15

                return false;   ↵

14

            }↵

16

            }↵

15

            return super.equals(obj)↵

17

            if (!ObjectUtilities.equal(this.gradientPaintTransformer, ↵

18

                    that.gradientPaintTransformer)) {↵

19

                return false;   ↵

20

            }↵

16

    ;

21

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 9
   Number of unmapped statements in the first code fragment | 1
   Number of unmapped statements in the second code fragment | 5
   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;

   3

       if (!(obj instanceof LevelRenderer))

   3 | if (!(obj instanceof LevelRenderer))
   3 | if (!(obj instanceof IntervalMarker))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.LevelRenderer | org.jfree.chart.plot.IntervalMarker | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof IntervalMarker))

   4

       return false;

   4

       return false;

   5

       if (!super.equals(obj))

   6 | return false;

   Preondition Violations
   Unmatched return false;

   6

       return false;

   5

       LevelRenderer that = (LevelRenderer)obj;

   7

       IntervalMarker that = (IntervalMarker)obj;

   6

       if (this.itemMargin != that.itemMargin)

   6 | if (this.itemMargin != that.itemMargin)
   8 | if (this.startValue != that.startValue)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   itemMargin | startValue | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.category.LevelRenderer | org.jfree.chart.plot.IntervalMarker | VARIABLE_TYPE_MISMATCH
   itemMargin | startValue | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.renderer.category.LevelRenderer of variable that does not match with type org.jfree.chart.plot.IntervalMarker of variable that
   - Make classes org.jfree.chart.renderer.category.LevelRenderer and org.jfree.chart.plot.IntervalMarker extend a common superclass

   8

       if (this.startValue != that.startValue)

   7

       return false;

   9

       return false;

   8

       if (this.maxItemWidth != that.maxItemWidth)

   8 | if (this.maxItemWidth != that.maxItemWidth)
   10 | if (this.endValue != that.endValue)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   maxItemWidth | endValue | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.category.LevelRenderer | org.jfree.chart.plot.IntervalMarker | VARIABLE_TYPE_MISMATCH
   maxItemWidth | endValue | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.renderer.category.LevelRenderer of variable that does not match with type org.jfree.chart.plot.IntervalMarker of variable that
   - Make classes org.jfree.chart.renderer.category.LevelRenderer and org.jfree.chart.plot.IntervalMarker extend a common superclass

   10

       if (this.endValue != that.endValue)

   9

       return false;

   11

       return false;

   12

       if (!ObjectUtilities.equal(this.gradientPaintTransformer, that.gradientPaintTransformer))

   13 | return false;

   Preondition Violations
   Unmatched return false;

   13

       return false;

   10

       return super.equals(obj);

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

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

   14

       return true;

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof LevelRenderer does not match with type boolean of variable obj instanceof IntervalMarker
   2 | Unmatched return false;
   3 | Type org.jfree.chart.renderer.category.LevelRenderer of variable that does not match with type org.jfree.chart.plot.IntervalMarker of variable that
   4 | Type org.jfree.chart.renderer.category.LevelRenderer of variable that does not match with type org.jfree.chart.plot.IntervalMarker of variable that
   5 | Unmatched return false;