43-18-43

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 ModuloAxis)) { return false; } ModuloAxis that = (ModuloAxis) obj; if (this.displayStart != that.displayStart) { return false; } if (this.displayEnd != that.displayEnd) { return false; } if (!this.fixedRange.equals(that.fixedRange)) { return false; } return super.equals(obj);

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/axis/ModuloAxis.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 14 |  | Number of AST nodes: 12

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 ModuloAxis)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            LookupPaintScale that = (LookupPaintScale) obj;↵

7

            ModuloAxis that = (ModuloAxis) obj;↵

8

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

8

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

9

                return false;↵

9

                return false;↵

10

            }↵

10

            }↵

11

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

11

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

12

                return false;↵

12

                return false;↵

13

            }↵

13

            }↵

14

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

14

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

15

                return false;↵

15

                return false;↵

16

            }↵

16

            }↵

17

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

17

            ↵

18

                return false;↵

19

            }↵

20

            return true;

18

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 11
   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) | 1.2
   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 LookupPaintScale))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.LookupPaintScale | org.jfree.chart.axis.ModuloAxis | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof ModuloAxis))

   4

       return false;

   4

       return false;

   5

       ModuloAxis that = (ModuloAxis)obj;

   5

       LookupPaintScale that = (LookupPaintScale)obj;

   6

       if (this.lowerBound != that.lowerBound)

   6 | if (this.lowerBound != that.lowerBound)
   6 | if (this.displayStart != that.displayStart)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   lowerBound | displayStart | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.LookupPaintScale | org.jfree.chart.axis.ModuloAxis | VARIABLE_TYPE_MISMATCH
   lowerBound | displayStart | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   6

       if (this.displayStart != that.displayStart)

   7

       return false;

   7

       return false;

   8

       if (this.upperBound != that.upperBound)

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   upperBound | displayEnd | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.LookupPaintScale | org.jfree.chart.axis.ModuloAxis | VARIABLE_TYPE_MISMATCH
   upperBound | displayEnd | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   8

       if (this.displayEnd != that.displayEnd)

   9

       return false;

   9

       return false;

   10

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

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

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

   12 | if (! this.lookupTable.equals(that.lookupTable))
   10 | if (! this.fixedRange.equals(that.fixedRange))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.LookupPaintScale | org.jfree.chart.axis.ModuloAxis | VARIABLE_TYPE_MISMATCH
   lookupTable | fixedRange | VARIABLE_NAME_MISMATCH
   java.util.List | org.jfree.data.Range | VARIABLE_TYPE_MISMATCH
   lookupTable | fixedRange | VARIABLE_NAME_MISMATCH
   java.util.List | org.jfree.data.Range | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   Type java.util.List of variable that.lookupTable does not match with type org.jfree.data.Range of variable that.fixedRange
   - Make classes java.util.List and org.jfree.data.Range extend a common superclass

   Type java.util.List of variable this.lookupTable does not match with type org.jfree.data.Range of variable this.fixedRange
   - Make classes java.util.List and org.jfree.data.Range extend a common superclass

   10

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

   13

       return false;

   11

       return false;

   14

       return true;

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

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

   12

       return super.equals(obj);

   Precondition Violations (7)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof LookupPaintScale does not match with type boolean of variable obj instanceof ModuloAxis
   2 | Type org.jfree.chart.renderer.LookupPaintScale of variable that does not match with type org.jfree.chart.axis.ModuloAxis of variable that
   3 | Type org.jfree.chart.renderer.LookupPaintScale of variable that does not match with type org.jfree.chart.axis.ModuloAxis of variable that
   4 | Unmatched return false;
   5 | Type org.jfree.chart.renderer.LookupPaintScale of variable that does not match with type org.jfree.chart.axis.ModuloAxis of variable that
   6 | Type java.util.List of variable that.lookupTable does not match with type org.jfree.data.Range of variable that.fixedRange
   7 | Type java.util.List of variable this.lookupTable does not match with type org.jfree.data.Range of variable this.fixedRange