43-11-139

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 StandardXYZToolTipGenerator)) { return false; } if (!super.equals(obj)) { return false; } StandardXYZToolTipGenerator that = (StandardXYZToolTipGenerator) obj; if (!ObjectUtilities.equal(this.zFormat, that.zFormat)) { return false; } if (!ObjectUtilities.equal(this.zDateFormat, that.zDateFormat)) { return false; } return true;

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/labels/StandardXYZToolTipGenerator.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 16 |  | 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 XYStepAreaRenderer)) {↵

4

            if (!(obj instanceof ↵

5

                return false;↵

6

            }↵

7

            XYStepAreaRenderer that = (XYStepAreaRenderer) obj;↵

8

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

5

    StandardXYZToolTipGenerator)) {↵

9

                return false;↵

6

                return false;↵

10

            }↵

7

            }↵

11

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

8

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

12

                return false;↵

9

                return false;↵

13

            }↵

10

            }↵

14

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

11

            StandardXYZToolTipGenerator that = (StandardXYZToolTipGenerator) obj;↵

15

                return false;↵

12

            ↵

16

            }↵

17

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

13

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

18

                return false;↵

14

                return false;↵

19

            }↵

15

            }↵

20

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

16

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

21

                return false;↵

17

                return false;↵

22

            }↵

18

            }↵

23

            return super.equals(obj);

19

            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 | 44

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.XYStepAreaRenderer | org.jfree.chart.labels.StandardXYZToolTipGenerator | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof StandardXYZToolTipGenerator))

   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 StandardXYZToolTipGenerator
   2 | Conditional return true;
   3 | Conditional return true;
   4 | Conditional return false;
   5 | Conditional return false;