43-105-131

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);
if (obj == this) { return true; } if (!(obj instanceof ImageTitle)) { return false; } ImageTitle that = (ImageTitle) obj; if (!ObjectUtilities.equal(this.image, that.image)) { 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/XYAreaRenderer2.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/title/ImageTitle.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 10 |  | Number of AST nodes: 8

1

    if (obj == this) {    ↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof XYAreaRenderer2)) {↵

4

            if (!(obj instanceof ImageTitle)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            XYAreaRenderer2 that = (XYAreaRenderer2) obj;↵

7

            ↵

8

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

9

                return false;↵

10

            }↵

11

            if (!Shape↵

8

    ImageTitle that = (ImageTitle) obj;↵

12

    Utilities.equal(this.legendArea, that.legendArea)) {↵

9

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

13

                return false;↵

10

                return false;↵

14

            }↵

11

            }↵

15

            return super.equals(obj);

12

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 7
   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) | 0.7
   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 XYAreaRenderer2))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.XYAreaRenderer2 | org.jfree.chart.title.ImageTitle | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof ImageTitle))

   4

       return false;

   4

       return false;

   5

       ImageTitle that = (ImageTitle)obj;

   5

       XYAreaRenderer2 that = (XYAreaRenderer2)obj;

   6

       if (this.showOutline != that.showOutline)

   7

       return false;

   7 | return false;

   Preondition Violations
   Unmatched return false;

   8

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

   8 | if (! ShapeUtilities.equal(this.legendArea, that.legendArea))
   6 | if (! ObjectUtilities.equal(this.image, that.image))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   legendArea | image | VARIABLE_NAME_MISMATCH
   java.awt.Shape | java.awt.Image | VARIABLE_TYPE_MISMATCH
   org.jfree.util.ShapeUtilities | org.jfree.util.ObjectUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

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

   6

       if (!ObjectUtilities.equal(this.image, that.image))

   9

       return false;

   7

       return false;

   10

       return super.equals(obj);

   8

       return super.equals(obj);

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof XYAreaRenderer2 does not match with type boolean of variable obj instanceof ImageTitle
   2 | Unmatched return false;
   3 | Type java.awt.Shape of variable this.legendArea does not match with type java.awt.Image of variable this.image
   4 | Type org.jfree.util.ShapeUtilities of variable ShapeUtilities does not match with type org.jfree.util.ObjectUtilities of variable ObjectUtilities