43-16-102

if (obj == this) { return true; } if (!(obj instanceof AxisSpace)) { return false; } AxisSpace that = (AxisSpace) obj; if (this.top != that.top) { return false; } if (this.bottom != that.bottom) { return false; } if (this.left != that.left) { return false; } if (this.right != that.right) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof StatisticalBarRenderer)) { return false; } StatisticalBarRenderer that = (StatisticalBarRenderer) obj; if (!PaintUtilities.equal(this.errorIndicatorPaint, that.errorIndicatorPaint)) { return false; } if (!ObjectUtilities.equal(this.errorIndicatorStroke, that.errorIndicatorStroke)) { return false; } return super.equals(obj);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/AxisSpace.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StatisticalBarRenderer.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 14 |  | Number of AST nodes: 10

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof AxisSpace)) {↵

4

            if (!(obj instanceof StatisticalBarRenderer)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            AxisSpace that = (AxisSpace) obj;↵

7

            ↵

8

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

9

                return false;↵

8

    StatisticalBarRenderer that = (StatisticalBarRenderer) obj;↵

9

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

10

            }   ↵

10

               ↵

11

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

11

         that.errorIndicatorPaint)) {↵

12

                return false;↵

12

                return false;↵

13

            }↵

13

            }↵

14

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

14

            if (↵

15

                return false;↵

15

    !ObjectUtilities.equal(this.errorIndicatorStroke,↵

16

            }↵

16

            ↵

17

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

17

            that.errorIndicatorStroke)) {↵

18

                return false;↵

18

                return false;↵

19

            }↵

19

            }↵

20

            return true;

20

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

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

   3 | if (!(obj instanceof AxisSpace))
   3 | if (!(obj instanceof StatisticalBarRenderer))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.axis.AxisSpace | org.jfree.chart.renderer.category.StatisticalBarRenderer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof StatisticalBarRenderer))

   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 AxisSpace does not match with type boolean of variable obj instanceof StatisticalBarRenderer
   2 | Conditional return true;
   3 | Conditional return true;
   4 | Conditional return false;
   5 | Conditional return false;