1162-2-5

if (obj == this) { return true; } if (obj instanceof StandardEntityCollection) { StandardEntityCollection that = (StandardEntityCollection) obj; return ObjectUtilities.equal(this.entities, that.entities); } return false;
if (obj == this) { return true; } if (!(obj instanceof DefaultMultiValueCategoryDataset)) { return false; } DefaultMultiValueCategoryDataset that = (DefaultMultiValueCategoryDataset) obj; return this.data.equals(that.data);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/entity/StandardEntityCollection.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/statistics/DefaultMultiValueCategoryDataset.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;   ↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (obj instanceof StandardEntityCollection) {↵

4

            if (!(obj instanceof ↵

5

                StandardEntityCollection that = (StandardEntityCollection) obj↵

5

    DefaultMultiValueCategoryDataset)) {↵

6

    ;↵

6

                return false;↵

7

           ↵

7

            }↵

8

         return ObjectUtilities.equal(this.entities, that.entities);↵

8

         ↵

9

            }↵

10

            return false↵

9

       DefaultMultiValueCategoryDataset that ↵

10

                    = (DefaultMultiValueCategoryDataset) obj;↵

11

    ;

11

            return this.data.equals(that.data);

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2
Clones location | Clones are in different classes
Number of node comparisons | 7

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 2
   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.3
   Clone type | Type 1

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

   1

       if (obj == this)

   1

       if (obj == this)

   2

       return true;

   2

       return true;

   Precondition Violations (0)
   Row | Violation
   --- | ---