43-125-153

if (obj == this) { return true; } if (!(obj instanceof CategoryStepRenderer)) { return false; } CategoryStepRenderer that = (CategoryStepRenderer) obj; if (this.stagger != that.stagger) { 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/renderer/category/CategoryStepRenderer.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 CategoryStepRenderer)) {↵

4

            if (!(obj instanceof ↵

5

                return false;↵

6

            }↵

7

            CategoryStepRenderer that = (CategoryStepRender↵

5

    NumberAxis)) {↵

6

                return false;↵

7

            }↵

8

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

9

                return false;↵

10

            }↵

11

            NumberAxis that = (NumberAxis) obj;↵

8

    er) obj;↵

12

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

9

            if (this.stagg↵

13

    {↵

14

                return false;↵

15

            }↵

10

    er != that.stagger) {↵

16

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

11

                return false;↵

17

                return false;↵

12

            }↵

18

            }↵

13

            return su↵

19

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

20

                return false;↵

21

            }↵

22

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

23

                    that.numberFormatOverride)) {↵

24

                return false;↵

25

            }↵

14

    per.equals(obj)↵

26

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

27

                return false;↵

28

            }↵

15

    ;

29

            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 | 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 CategoryStepRenderer))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.CategoryStepRenderer | org.jfree.chart.axis.NumberAxis | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof NumberAxis))

   4

       return false;

   4

       return false;

   5

       if (!super.equals(obj))

   6 | return false;

   Preondition Violations
   Unmatched return false;

   6

       return false;

   5

       CategoryStepRenderer that = (CategoryStepRenderer)obj;

   7

       NumberAxis that = (NumberAxis)obj;

   6

       if (this.stagger != that.stagger)

   6 | if (this.stagger != that.stagger)
   8 | if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   stagger | autoRangeIncludesZero | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.category.CategoryStepRenderer | org.jfree.chart.axis.NumberAxis | VARIABLE_TYPE_MISMATCH
   stagger | autoRangeIncludesZero | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   8

       if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)

   7

       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 (7)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof CategoryStepRenderer does not match with type boolean of variable obj instanceof NumberAxis
   2 | Unmatched return false;
   3 | Type org.jfree.chart.renderer.category.CategoryStepRenderer of variable that does not match with type org.jfree.chart.axis.NumberAxis of variable that
   4 | Unmatched return false;
   5 | Unmatched return false;
   6 | Unmatched return false;
   7 | Unmatched return false;