43-21-153

if (obj == this) { return true; } if (!(obj instanceof XYErrorRenderer)) { return false; } XYErrorRenderer that = (XYErrorRenderer) obj; if (this.drawXError != that.drawXError) { return false; } if (this.drawYError != that.drawYError) { return false; } if (this.capLength != that.capLength) { return false; } if (!PaintUtilities.equal(this.errorPaint, that.errorPaint)) { 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/xy/XYErrorRenderer.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: 14 |  | 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 XYErrorRenderer)) {↵

4

            if (!(obj instanceof NumberAxis)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            XYErrorRenderer that = (XYErrorRenderer↵

7

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

8

                return false;↵

9

            }↵

8

    ) obj;↵

10

            NumberAxis that = (NumberAxis) obj;↵

9

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

11

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

10

                return false;↵

12

                return false;↵

11

            }↵

13

            }↵

12

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

14

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

13

                return false;↵

15

                return false;↵

14

            }↵

16

            }↵

15

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

17

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

16

                return false;↵

18

                return false;↵

17

            }↵

19

            }↵

18

            if (!PaintUtilities.equal(this.errorPaint,↵

20

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

19

     that.errorPaint)) {↵

21

                    that.numberFormatOverride)) {↵

20

                return false;↵

22

                return false;↵

21

            }↵

23

            }↵

22

            return super.equals(obj)↵

24

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

25

                return false;↵

26

            }↵

23

    ;

27

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 10
   Number of unmapped statements in the first code fragment | 3
   Number of unmapped statements in the second code fragment | 1
   Time elapsed for statement mapping (ms) | 1.2
   Clone type | Type 3

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

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.XYErrorRenderer | org.jfree.chart.axis.NumberAxis | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof NumberAxis))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       XYErrorRenderer that = (XYErrorRenderer)obj;

   7

       NumberAxis that = (NumberAxis)obj;

   6

       if (this.drawXError != that.drawXError)

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   drawXError | autoRangeIncludesZero | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.xy.XYErrorRenderer | org.jfree.chart.axis.NumberAxis | VARIABLE_TYPE_MISMATCH
   drawXError | autoRangeIncludesZero | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   8

       if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)

   7

       return false;

   7 | return false;
   9 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   9

       return false;

   8

       if (this.drawYError != that.drawYError)

   8 | if (this.drawYError != that.drawYError)
   10 | if (this.autoRangeStickyZero != that.autoRangeStickyZero)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   drawYError | autoRangeStickyZero | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.xy.XYErrorRenderer | org.jfree.chart.axis.NumberAxis | VARIABLE_TYPE_MISMATCH
   drawYError | autoRangeStickyZero | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   10

       if (this.autoRangeStickyZero != that.autoRangeStickyZero)

   9

       return false;

   9 | return false;
   11 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   11

       return false;

   10

       if (this.capLength != that.capLength)

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

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

   12 | if (! PaintUtilities.equal(this.errorPaint, that.errorPaint))
   5 | if (! super.equals(obj))

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

   5

       if (!super.equals(obj))

   13

       return false;

   13 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

   Precondition Violations (14)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof XYErrorRenderer does not match with type boolean of variable obj instanceof NumberAxis
   2 | Type org.jfree.chart.renderer.xy.XYErrorRenderer of variable that does not match with type org.jfree.chart.axis.NumberAxis of variable that
   3 | Type org.jfree.chart.renderer.xy.XYErrorRenderer of variable that does not match with type org.jfree.chart.axis.NumberAxis of variable that
   4 | Unmatched return false;
   5 | Conditional return true;
   6 | Conditional return true;
   7 | Conditional return false;
   8 | Conditional return false;
   9 | Conditional return false;
   10 | Conditional return false;
   11 | Conditional return false;
   12 | Conditional return false;
   13 | Conditional return false;
   14 | Conditional return false;