43-114-134

if (obj == this) { return true; } if (!(obj instanceof TaskSeriesCollection)) { return false; } TaskSeriesCollection that = (TaskSeriesCollection) obj; if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof CategoryLabelEntity)) { return false; } CategoryLabelEntity that = (CategoryLabelEntity) obj; if (!ObjectUtilities.equal(this.key, that.key)) { return false; } return super.equals(obj);

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

4

            if (!(obj instanceof CategoryLabelEntity)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            TaskSeriesCollection that = (TaskSeriesCollection) obj;↵

7

            CategoryLabelEntity that = (CategoryLabelEntity) obj;↵

8

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

8

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

9

                return false;↵

9

                return false;↵

10

            }↵

10

            }↵

11

            return true;

11

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

1. {Non-refactorable}

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

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

   1

       if (obj == this)

   1

       if (obj == this)

   2

       return true;

   2

       return true;

   3

       if (!(obj instanceof TaskSeriesCollection))

   3 | if (!(obj instanceof TaskSeriesCollection))
   3 | if (!(obj instanceof CategoryLabelEntity))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.gantt.TaskSeriesCollection | org.jfree.chart.entity.CategoryLabelEntity | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof TaskSeriesCollection does not match with type boolean of variable obj instanceof CategoryLabelEntity
   - Make classes org.jfree.data.gantt.TaskSeriesCollection and org.jfree.chart.entity.CategoryLabelEntity extend a common superclass

   3

       if (!(obj instanceof CategoryLabelEntity))

   4

       return false;

   4

       return false;

   5

       CategoryLabelEntity that = (CategoryLabelEntity)obj;

   5

       TaskSeriesCollection that = (TaskSeriesCollection)obj;

   6

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

   6 | if (! ObjectUtilities.equal(this.data, that.data))
   6 | if (! ObjectUtilities.equal(this.key, that.key))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   data | key | VARIABLE_NAME_MISMATCH
   java.util.List | java.lang.Comparable | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.util.List of variable this.data does not match with type java.lang.Comparable of variable this.key
   - Make classes java.util.List and java.lang.Comparable extend a common superclass

   6

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

   7

       return false;

   7

       return false;

   8

       return true;

   8 | return true;
   8 | return super.equals(obj);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   true | super.equals(obj) | TYPE_COMPATIBLE_REPLACEMENT

   8

       return super.equals(obj);

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof TaskSeriesCollection does not match with type boolean of variable obj instanceof CategoryLabelEntity
   2 | Type java.util.List of variable this.data does not match with type java.lang.Comparable of variable this.key