43-18-142

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;
if (obj == this) { return true; } if (!(obj instanceof CombinedRangeCategoryPlot)) { return false; } if (!super.equals(obj)) { return false; } CombinedRangeCategoryPlot that = (CombinedRangeCategoryPlot) obj; if (!ObjectUtilities.equal(this.subplots, that.subplots)) { return false; } if (this.totalWeight != that.totalWeight) { return false; } if (this.gap != that.gap) { return false; } return true;

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

4

            if (!(obj instanceof CombinedRangeCategoryPlot)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            LookupPaintScale that = (LookupPaintScale) obj;↵

7

            ↵

8

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

9

                return false;↵

10

            }↵

11

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

12

                return false;↵

13

            }↵

14

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

8

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

9

                return false;↵

10

            }↵

11

            CombinedRangeCategoryPlot that = (CombinedRangeCategoryPlot) obj;↵

12

            if (!ObjectUtilities.equal(this.subplots, that.subplots)) {↵

13

                return false;↵

14

            }↵

15

    ) {↵

15

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

16

                return false;↵

16

                return false;↵

17

            }↵

17

            }↵

18

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

18

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

19

                return false;↵

19

                return false;↵

20

            }↵

20

            }↵

21

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

1. {Non-refactorable}

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

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

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

   Preondition Violations

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

   3

       if (!(obj instanceof CombinedRangeCategoryPlot))

   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;

   7

       CombinedRangeCategoryPlot that = (CombinedRangeCategoryPlot)obj;

   8

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

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   10

       if (this.totalWeight != that.totalWeight)

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   6

       if (this.lowerBound != that.lowerBound)

   6 | if (this.lowerBound != that.lowerBound)
   12 | if (this.gap != that.gap)

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

   Preondition Violations

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

   12

       if (this.gap != that.gap)

   7

       return false;

   7 | return false;
   13 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   13

       return false;

   8

       if (this.upperBound != that.upperBound)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

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

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

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

   5

       if (!super.equals(obj))

   11

       return false;

   11 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

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