342-7-8

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;
if (obj == this) { return true; } if (!(obj instanceof LookupPaintScale)) { return false; } LookupPaintScale that = (LookupPaintScale) obj; if (this.lowerBound != that.lowerBound) { return false; } if (this.upperBound != that.upperBound) { return false; } if (!PaintUtilities.equal(this.defaultPaint, that.defaultPaint)) { return false; } if (!this.lookupTable.equals(that.lookupTable)) { return false; } return true;

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

4

            if (!(obj instanceof LookupPaintScale)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

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

7

            ↵

8

                return false;↵

9

            }↵

10

            IntervalMarker that = (IntervalMarker) obj;↵

8

    LookupPaintScale that = (LookupPaintScale) obj;↵

11

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

9

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

12

                return false;   ↵

10

                return false;↵

13

            }↵

11

            }↵

14

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

12

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

15

                return false;   ↵

13

                return false;↵

16

            }↵

14

            }↵

17

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

15

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

16

                return false;↵

18

            ↵

17

            }↵

19

            that.gradientPaintTransformer)) {↵

18

            if (!this.lookupTable.equals(that.lookupTable)) {↵

20

                return false;   ↵

19

                return false;↵

21

            }↵

20

            }↵

22

            return true;

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

1. {Non-refactorable}

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

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

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

   Preondition Violations

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

   3

       if (!(obj instanceof LookupPaintScale))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       LookupPaintScale that = (LookupPaintScale)obj;

   5

       if (!super.equals(obj))

   5 | if (! super.equals(obj))
   10 | if (! PaintUtilities.equal(this.defaultPaint, that.defaultPaint))

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

   10

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

   6

       return false;

   6 | return false;
   11 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   11

       return false;

   7

       IntervalMarker that = (IntervalMarker)obj;

   8

       if (this.startValue != that.startValue)

   8 | if (this.startValue != that.startValue)
   8 | if (this.upperBound != that.upperBound)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   startValue | upperBound | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.IntervalMarker | org.jfree.chart.renderer.LookupPaintScale | VARIABLE_TYPE_MISMATCH
   startValue | upperBound | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   8

       if (this.upperBound != that.upperBound)

   9

       return false;

   9 | return false;
   9 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   9

       return false;

   10

       if (this.endValue != that.endValue)

   10 | if (this.endValue != that.endValue)
   6 | if (this.lowerBound != that.lowerBound)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   endValue | lowerBound | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.IntervalMarker | org.jfree.chart.renderer.LookupPaintScale | VARIABLE_TYPE_MISMATCH
   endValue | lowerBound | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   6

       if (this.lowerBound != that.lowerBound)

   11

       return false;

   11 | return false;
   7 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   7

       return false;

   Precondition Violations (13)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof IntervalMarker does not match with type boolean of variable obj instanceof LookupPaintScale
   2 | Type org.jfree.chart.plot.IntervalMarker of variable that does not match with type org.jfree.chart.renderer.LookupPaintScale of variable that
   3 | Type org.jfree.chart.plot.IntervalMarker of variable that does not match with type org.jfree.chart.renderer.LookupPaintScale of variable that
   4 | Conditional return true;
   5 | Conditional return true;
   6 | Conditional return false;
   7 | Conditional return false;
   8 | Conditional return false;
   9 | Conditional return false;
   10 | Conditional return false;
   11 | Conditional return false;
   12 | Conditional return false;
   13 | Conditional return false;