43-11-29

if (obj == this) { return true; } if (!(obj instanceof XYStepAreaRenderer)) { return false; } XYStepAreaRenderer that = (XYStepAreaRenderer) obj; if (this.showOutline != that.showOutline) { return false; } if (this.shapesVisible != that.shapesVisible) { return false; } if (this.shapesFilled != that.shapesFilled) { return false; } if (this.plotArea != that.plotArea) { return false; } if (this.rangeBase != that.rangeBase) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof CategoryItemEntity)) { return false; } CategoryItemEntity that = (CategoryItemEntity) obj; if (!this.rowKey.equals(that.rowKey)) { return false; } if (!this.columnKey.equals(that.columnKey)) { return false; } if (!ObjectUtilities.equal(this.dataset, that.dataset)) { return false; } // check the deprecated fields if (this.categoryIndex != that.categoryIndex) { return false; } if (this.series != that.series) { return false; } if (!ObjectUtilities.equal(this.category, that.category)) { return false; } return super.equals(obj);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYStepAreaRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/entity/CategoryItemEntity.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 16 |  | 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 XYStepAreaRenderer)) {↵

4

            if (!(obj instanceof CategoryItemEntity)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            XYStepAreaRenderer that = (XYStepAreaRenderer) obj;↵

7

            CategoryItemEntity that = (CategoryItemEntity) obj;↵

8

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

8

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

9

                return false;↵

9

                return false;↵

10

            }↵

10

            }↵

11

            if (this.shapesVisible != that.shapesVisible↵

11

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

12

                return false;↵

13

            }↵

12

    ) {↵

14

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

13

                return false;↵

15

                return false;↵

14

            }↵

16

            }↵

15

            if (this.shapesFilled != that.shapesFilled↵

17

            ↵

18

            // check the deprecated fields↵

16

    ) {↵

19

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

17

                return false;↵

20

                return false;   ↵

18

            }↵

21

            }↵

19

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

22

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

20

                return false;↵

23

                return false;   ↵

21

            }↵

24

            }↵

22

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

25

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

23

                return false;↵

26

                return false;   ↵

24

            }↵

27

            }↵

25

            return super.equals(obj);

28

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 4
   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.4
   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 (!(obj instanceof XYStepAreaRenderer))

   3 | if (!(obj instanceof XYStepAreaRenderer))
   3 | if (!(obj instanceof CategoryItemEntity))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.XYStepAreaRenderer | org.jfree.chart.entity.CategoryItemEntity | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof XYStepAreaRenderer does not match with type boolean of variable obj instanceof CategoryItemEntity
   - Make classes org.jfree.chart.renderer.xy.XYStepAreaRenderer and org.jfree.chart.entity.CategoryItemEntity extend a common superclass

   3

       if (!(obj instanceof CategoryItemEntity))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

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