398-6-9

if (obj == this) { return true; } if (!(obj instanceof AbstractDialLayer)) { return false; } AbstractDialLayer that = (AbstractDialLayer) obj; return this.visible == that.visible;
if (obj == this) { return true; } if (!(obj instanceof YIntervalSeriesCollection)) { return false; } YIntervalSeriesCollection that = (YIntervalSeriesCollection) obj; return ObjectUtilities.equal(this.data, that.data);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/AbstractDialLayer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/xy/YIntervalSeriesCollection.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 AbstractDialLayer)) {↵

4

            if (!(obj instanceof YIntervalSeriesCollection)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            AbstractDialLayer that = (AbstractDialLayer) obj;↵

7

            ↵

8

            return this.visible == that.visible↵

8

    YIntervalSeriesCollection that = (YIntervalSeriesCollection) obj;↵

9

    ;

9

            return ObjectUtilities.equal(this.data, that.data);

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 5
   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.7
   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 AbstractDialLayer))

   3 | if (!(obj instanceof AbstractDialLayer))
   3 | if (!(obj instanceof YIntervalSeriesCollection))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.dial.AbstractDialLayer | org.jfree.data.xy.YIntervalSeriesCollection | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof AbstractDialLayer does not match with type boolean of variable obj instanceof YIntervalSeriesCollection
   - Make classes org.jfree.chart.plot.dial.AbstractDialLayer and org.jfree.data.xy.YIntervalSeriesCollection extend a common superclass

   3

       if (!(obj instanceof YIntervalSeriesCollection))

   4

       return false;

   4

       return false;

   5

       YIntervalSeriesCollection that = (YIntervalSeriesCollection)obj;

   5

       AbstractDialLayer that = (AbstractDialLayer)obj;

   6

       return this.visible == that.visible;

   6 | return this.visible == that.visible;
   6 | return ObjectUtilities.equal(this.data, that.data);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   this.visible == that.visible | ObjectUtilities.equal(this.data,that.data) | TYPE_COMPATIBLE_REPLACEMENT

   6

       return ObjectUtilities.equal(this.data, that.data);

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof AbstractDialLayer does not match with type boolean of variable obj instanceof YIntervalSeriesCollection