43-21-105

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 XYAreaRenderer2)) { return false; } XYAreaRenderer2 that = (XYAreaRenderer2) obj; if (this.showOutline != that.showOutline) { return false; } if (!ShapeUtilities.equal(this.legendArea, that.legendArea)) { 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/XYErrorRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYAreaRenderer2.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 XYErrorRenderer)) {↵

4

            if (!(obj instanceof XYAreaRenderer2)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            XYErrorRenderer that = (XYErrorRenderer) obj;↵

7

            XYAreaRenderer2 that = (XYAreaRenderer2) obj;↵

8

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

8

            if (this.↵

9

                return false;↵

10

            }↵

11

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

12

                return false;↵

13

            }↵

14

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

9

    showOutline != that.showOutline) {↵

15

                return false;↵

10

                return false;↵

16

            }↵

11

            }↵

17

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

12

            if (!ShapeUtilities.equal(this.legendArea, that.legendArea)) {↵

18

                return false;↵

13

                return false;↵

19

            }↵

14

            }↵

20

            return super.equals(obj);

15

            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.9
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 58

1. {Non-refactorable}

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

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   1

       if (obj == this)

   1

       if (obj == this)

   2

       return true;

   2

       return true;

   3

       if (!(obj instanceof XYErrorRenderer))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.XYErrorRenderer | org.jfree.chart.renderer.xy.XYAreaRenderer2 | SUBCLASS_TYPE_MISMATCH

   3

       if (!(obj instanceof XYAreaRenderer2))

   4

       return false;

   4

       return false;

   5

       XYErrorRenderer that = (XYErrorRenderer)obj;

   5 | XYErrorRenderer that = (XYErrorRenderer)obj;
   5 | XYAreaRenderer2 that = (XYAreaRenderer2)obj;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.XYErrorRenderer | org.jfree.chart.renderer.xy.XYAreaRenderer2 | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.xy.XYErrorRenderer | org.jfree.chart.renderer.xy.XYAreaRenderer2 | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.xy.XYErrorRenderer | org.jfree.chart.renderer.xy.XYAreaRenderer2 | SUBCLASS_TYPE_MISMATCH

   5

       XYAreaRenderer2 that = (XYAreaRenderer2)obj;

   6

       if (this.drawXError != that.drawXError)

   6 | if (this.drawXError != that.drawXError)
   6 | if (this.showOutline != that.showOutline)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   drawXError | showOutline | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.xy.XYErrorRenderer | org.jfree.chart.renderer.xy.XYAreaRenderer2 | SUBCLASS_TYPE_MISMATCH
   drawXError | showOutline | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression that.drawXError cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression that.showOutline cannot be parameterized, because it has dependencies to/from statements that will be extracted

   6

       if (this.showOutline != that.showOutline)

   7

       return false;

   7

       return false;

   8

       if (this.drawYError != that.drawYError)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched 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))
   8 | if (! ShapeUtilities.equal(this.legendArea, that.legendArea))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   errorPaint | legendArea | VARIABLE_NAME_MISMATCH
   java.awt.Paint | java.awt.Shape | VARIABLE_TYPE_MISMATCH
   org.jfree.util.PaintUtilities | org.jfree.util.ShapeUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.awt.Paint of variable this.errorPaint does not match with type java.awt.Shape of variable this.legendArea
   - Make classes java.awt.Paint and java.awt.Shape extend a common superclass

   Type org.jfree.util.PaintUtilities of variable PaintUtilities does not match with type org.jfree.util.ShapeUtilities of variable ShapeUtilities
   - Make classes org.jfree.util.PaintUtilities and org.jfree.util.ShapeUtilities extend a common superclass

   8

       if (!ShapeUtilities.equal(this.legendArea, that.legendArea))

   13

       return false;

   9

       return false;

   14

       return super.equals(obj);

   10

       return super.equals(obj);

   Precondition Violations (7)
   Row | Violation
   --- | ---
   1 | Expression that.drawXError cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression that.showOutline cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Type java.awt.Paint of variable this.errorPaint does not match with type java.awt.Shape of variable this.legendArea
   6 | Type org.jfree.util.PaintUtilities of variable PaintUtilities does not match with type org.jfree.util.ShapeUtilities of variable ShapeUtilities
   7 | Clone fragment #1 returns variables that , while Clone fragment #2 returns variables