43-133-153

if (obj == this) { return true; } if (!(obj instanceof ColorBlock)) { return false; } ColorBlock that = (ColorBlock) obj; if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof NumberAxis)) { return false; } if (!super.equals(obj)) { return false; } NumberAxis that = (NumberAxis) obj; if (this.autoRangeIncludesZero != that.autoRangeIncludesZero) { return false; } if (this.autoRangeStickyZero != that.autoRangeStickyZero) { return false; } if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) { return false; } if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride)) { return false; } if (!this.rangeType.equals(that.rangeType)) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/block/ColorBlock.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/NumberAxis.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 8 |  | Number of AST nodes: 18

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof ColorBlock)) {↵

4

            if (!(obj instanceof NumberAxis)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            ColorBlock that = (ColorBlock) obj;↵

7

            ↵

8

            if (!Pain↵

8

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

9

                return false;↵

10

            }↵

11

            NumberAxis that = (NumberAxis) obj;↵

12

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

13

                return false;↵

14

            }↵

15

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

16

                return false;↵

17

            }↵

9

    tUtilities.equal(this.paint, that.paint)) {↵

18

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

10

                return false;↵

19

                return false;↵

11

            }↵

20

            }↵

12

            return super.equals(obj)↵

21

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

22

                    that.numberFormatOverride)) {↵

23

                return false;↵

24

            }↵

25

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

26

                return false;↵

27

            }↵

13

    ;

28

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

1. {Non-refactorable}

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

   3

       if (!(obj instanceof ColorBlock))

   3 | if (!(obj instanceof ColorBlock))
   3 | if (!(obj instanceof NumberAxis))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.block.ColorBlock | org.jfree.chart.axis.NumberAxis | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof NumberAxis))

   4

       return false;

   4

       return false;

   5

       ColorBlock that = (ColorBlock)obj;

   6

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

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

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

   5

       if (!super.equals(obj))

   7

       return false;

   6

       return false;

   7

       NumberAxis that = (NumberAxis)obj;

   8

       if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   10

       if (this.autoRangeStickyZero != that.autoRangeStickyZero)

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   12

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

   13 | return false;

   Preondition Violations
   Unmatched return false;

   13

       return false;

   14

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

   15 | return false;

   Preondition Violations
   Unmatched return false;

   15

       return false;

   16

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

   17 | return false;

   Preondition Violations
   Unmatched return false;

   17

       return false;

   8

       return super.equals(obj);

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

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

   18

       return true;

   Precondition Violations (6)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof ColorBlock does not match with type boolean of variable obj instanceof NumberAxis
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Unmatched return false;
   6 | Unmatched return false;