43-26-112

if (obj == this) { return true; } if (!(obj instanceof CategoryLabelPosition)) { return false; } CategoryLabelPosition that = (CategoryLabelPosition) obj; if (!this.categoryAnchor.equals(that.categoryAnchor)) { return false; } if (!this.labelAnchor.equals(that.labelAnchor)) { return false; } if (!this.rotationAnchor.equals(that.rotationAnchor)) { return false; } if (this.angle != that.angle) { return false; } if (this.widthType != that.widthType) { return false; } if (this.widthRatio != that.widthRatio) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof DatasetGroup)) { return false; } DatasetGroup that = (DatasetGroup) obj; if (!this.id.equals(that.id)) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryLabelPosition.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/general/DatasetGroup.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 18 |  | 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 CategoryLabelPosition)) {↵

4

            if (!(obj instanceof DatasetGroup)) {↵

5

                return false;↵

5

                return false;   ↵

6

            }↵

6

            }↵

7

            CategoryLabelPosition that = (CategoryLabelPosition) obj;↵

7

            DatasetGroup that = (Dat↵

8

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

9

                return false;↵

10

            }↵

11

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

12

                return false;↵

13

            }↵

14

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

15

                return false;↵

16

            }↵

17

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

18

                return false;↵

19

            }↵

20

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

21

                return false;↵

22

            }↵

23

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

24

                return false;↵

8

    asetGroup) obj;↵

9

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

10

                return false;   ↵

25

            }↵

11

            }↵

26

            return true;

12

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 7
   Number of unmapped statements in the first code fragment | 11
   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 CategoryLabelPosition))

   3 | if (!(obj instanceof CategoryLabelPosition))
   3 | if (!(obj instanceof DatasetGroup))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.axis.CategoryLabelPosition | org.jfree.data.general.DatasetGroup | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof CategoryLabelPosition does not match with type boolean of variable obj instanceof DatasetGroup
   - Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.data.general.DatasetGroup extend a common superclass

   3

       if (!(obj instanceof DatasetGroup))

   4

       return false;

   4

       return false;

   5

       DatasetGroup that = (DatasetGroup)obj;

   5

       CategoryLabelPosition that = (CategoryLabelPosition)obj;

   6

       if (!this.categoryAnchor.equals(that.categoryAnchor))

   6 | if (! this.categoryAnchor.equals(that.categoryAnchor))
   6 | if (! this.id.equals(that.id))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.axis.CategoryLabelPosition | org.jfree.data.general.DatasetGroup | VARIABLE_TYPE_MISMATCH
   categoryAnchor | id | VARIABLE_NAME_MISMATCH
   org.jfree.ui.RectangleAnchor | java.lang.String | VARIABLE_TYPE_MISMATCH
   categoryAnchor | id | VARIABLE_NAME_MISMATCH
   org.jfree.ui.RectangleAnchor | java.lang.String | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.axis.CategoryLabelPosition of variable that does not match with type org.jfree.data.general.DatasetGroup of variable that
   - Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.data.general.DatasetGroup extend a common superclass

   Type org.jfree.ui.RectangleAnchor of variable that.categoryAnchor does not match with type java.lang.String of variable that.id
   - Make classes org.jfree.ui.RectangleAnchor and java.lang.String extend a common superclass

   Type org.jfree.ui.RectangleAnchor of variable this.categoryAnchor does not match with type java.lang.String of variable this.id
   - Make classes org.jfree.ui.RectangleAnchor and java.lang.String extend a common superclass

   6

       if (!this.id.equals(that.id))

   7

       return false;

   7

       return false;

   8

       if (!this.labelAnchor.equals(that.labelAnchor))

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

       if (!this.rotationAnchor.equals(that.rotationAnchor))

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

       if (this.angle != that.angle)

   13

       return false;

   13 | return false;

   Preondition Violations
   Unmatched return false;

   14

       if (this.widthType != that.widthType)

   15

       return false;

   15 | return false;

   Preondition Violations
   Unmatched return false;

   16

       if (this.widthRatio != that.widthRatio)

   17

       return false;

   17 | return false;

   Preondition Violations
   Unmatched return false;

   18

       return true;

   8

       return true;

   Precondition Violations (9)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof CategoryLabelPosition does not match with type boolean of variable obj instanceof DatasetGroup
   2 | Type org.jfree.chart.axis.CategoryLabelPosition of variable that does not match with type org.jfree.data.general.DatasetGroup of variable that
   3 | Type org.jfree.ui.RectangleAnchor of variable that.categoryAnchor does not match with type java.lang.String of variable that.id
   4 | Type org.jfree.ui.RectangleAnchor of variable this.categoryAnchor does not match with type java.lang.String of variable this.id
   5 | Unmatched return false;
   6 | Unmatched return false;
   7 | Unmatched return false;
   8 | Unmatched return false;
   9 | Unmatched return false;