398-1-4

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

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/time/ohlc/OHLCSeriesCollection.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/xy/XYIntervalSeriesCollection.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 OHLCSeriesCollection)) {↵

4

            if (!(obj instanceof XYIntervalSeriesCollection)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            OHLCSeriesCollection that = (OHLCSeriesCollection) obj;↵

7

            XYIntervalSeriesCollection that = (XYIntervalSeriesCollection) obj;↵

8

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

8

            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 | 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 having the same super class
Number of node comparisons | 17

1. {Refactorable}

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

   3 | if (!(obj instanceof OHLCSeriesCollection))
   3 | if (!(obj instanceof XYIntervalSeriesCollection))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.ohlc.OHLCSeriesCollection | org.jfree.data.xy.XYIntervalSeriesCollection | SUBCLASS_TYPE_MISMATCH

   3

       if (!(obj instanceof XYIntervalSeriesCollection))

   4

       return false;

   4

       return false;

   5

       OHLCSeriesCollection that = (OHLCSeriesCollection)obj;

   5 | OHLCSeriesCollection that = (OHLCSeriesCollection)obj;
   5 | XYIntervalSeriesCollection that = (XYIntervalSeriesCollection)obj;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.ohlc.OHLCSeriesCollection | org.jfree.data.xy.XYIntervalSeriesCollection | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.time.ohlc.OHLCSeriesCollection | org.jfree.data.xy.XYIntervalSeriesCollection | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.time.ohlc.OHLCSeriesCollection | org.jfree.data.xy.XYIntervalSeriesCollection | SUBCLASS_TYPE_MISMATCH

   5

       XYIntervalSeriesCollection that = (XYIntervalSeriesCollection)obj;

   6

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

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.ohlc.OHLCSeriesCollection | org.jfree.data.xy.XYIntervalSeriesCollection | SUBCLASS_TYPE_MISMATCH

   6

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

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