43-116-153

if (obj == this) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof XYAnnotationEntity)) { return false; } XYAnnotationEntity that = (XYAnnotationEntity) obj; if (this.rendererIndex != that.rendererIndex) { return false; } return true;
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/entity/XYAnnotationEntity.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: 10 |  | 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 NumberAxis)) {↵

5

                return false;↵

4

            }↵

6

            }↵

5

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

7

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

6

                return false;↵

8

                return false;↵

7

            }↵

9

            }↵

8

            if (!(obj instanceof XYAnnotationEntity)) {↵

10

            ↵

9

                return false;↵

10

            }↵

11

            XYAnnotationEntity that = (XYAnnotationEnt↵

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

            }↵

12

    ity) obj;↵

18

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

13

            if (this.rendererIndex != that.rendererIn↵

19

    {↵

20

                return false;↵

21

            }↵

22

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

14

    dex) {↵

23

                    that.numberFormatOverride)) {↵

15

                return false;   ↵

24

                return false;↵

25

            }↵

26

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

27

                return false;↵

16

            }↵

28

            }↵

17

            return true;

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 6
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 0.5
   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 (!super.equals(obj))

   5

       if (!super.equals(obj))

   4

       return false;

   4 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

   5

       if (!(obj instanceof XYAnnotationEntity))

   5 | if (!(obj instanceof XYAnnotationEntity))
   3 | if (!(obj instanceof NumberAxis))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.entity.XYAnnotationEntity | org.jfree.chart.axis.NumberAxis | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof NumberAxis))

   6

       return false;

   6 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

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