43-17-35

if (obj == this) { return true; } if (!(obj instanceof DefaultTableXYDataset)) { return false; } DefaultTableXYDataset that = (DefaultTableXYDataset) obj; if (this.autoPrune != that.autoPrune) { return false; } if (this.propagateEvents != that.propagateEvents) { return false; } if (!this.intervalDelegate.equals(that.intervalDelegate)) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof TimeSeriesCollection)) { return false; } TimeSeriesCollection that = (TimeSeriesCollection) obj; if (this.xPosition != that.xPosition) { return false; } if (this.domainIsPointsInTime != that.domainIsPointsInTime) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/xy/DefaultTableXYDataset.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/time/TimeSeriesCollection.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 14 |  | Number of AST nodes: 12

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof DefaultTableXYDataset)) {↵

4

            if (!(obj instanceof TimeSeriesCollection)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            DefaultTableXYDataset that = (DefaultTableXYDataset) obj;↵

7

            TimeSeriesCollection that = (TimeSeriesCollection) obj;↵

8

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

8

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

9

                return false;↵

9

                return false;↵

10

            }↵

10

            }↵

11

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

11

            if (this.↵

12

                return false;↵

13

            }↵

14

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

12

    domainIsPointsInTime != that.domainIsPointsInTime) {↵

15

                return false;↵

13

                return false;↵

16

            }↵

14

            }↵

17

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

15

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

18

                return false;↵

16

                return false;↵

19

            }↵

17

            }↵

20

            return true;

18

            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) | 1.3
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 61

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 9
   Number of unmapped statements in the first code fragment | 4
   Number of unmapped statements in the second code fragment | 2
   Time elapsed for statement mapping (ms) | 1.0
   Clone type | Type 3

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

   1

       if (obj == this)

   1

       if (obj == this)

   2

       return true;

   2 | return true;
   2 | return true;

   Preondition Violations
   Conditional return true;
   Conditional return true;

   2

       return true;

   3

       if (!(obj instanceof DefaultTableXYDataset))

   3 | if (!(obj instanceof DefaultTableXYDataset))
   3 | if (!(obj instanceof TimeSeriesCollection))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.DefaultTableXYDataset | org.jfree.data.time.TimeSeriesCollection | SUBCLASS_TYPE_MISMATCH

   3

       if (!(obj instanceof TimeSeriesCollection))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       DefaultTableXYDataset that = (DefaultTableXYDataset)obj;

   5 | DefaultTableXYDataset that = (DefaultTableXYDataset)obj;
   5 | TimeSeriesCollection that = (TimeSeriesCollection)obj;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.DefaultTableXYDataset | org.jfree.data.time.TimeSeriesCollection | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.DefaultTableXYDataset | org.jfree.data.time.TimeSeriesCollection | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.DefaultTableXYDataset | org.jfree.data.time.TimeSeriesCollection | SUBCLASS_TYPE_MISMATCH

   5

       TimeSeriesCollection that = (TimeSeriesCollection)obj;

   6

       if (this.xPosition != that.xPosition)

   7 | return false;

   Preondition Violations
   Unmatched return false;

   7

       return false;

   6

       if (this.autoPrune != that.autoPrune)

   6 | if (this.autoPrune != that.autoPrune)
   8 | if (this.domainIsPointsInTime != that.domainIsPointsInTime)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   autoPrune | domainIsPointsInTime | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.DefaultTableXYDataset | org.jfree.data.time.TimeSeriesCollection | SUBCLASS_TYPE_MISMATCH
   autoPrune | domainIsPointsInTime | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression that.autoPrune cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression that.domainIsPointsInTime cannot be parameterized, because it has dependencies to/from statements that will be extracted

   8

       if (this.domainIsPointsInTime != that.domainIsPointsInTime)

   7

       return false;

   7 | return false;
   9 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   9

       return false;

   8

       if (this.propagateEvents != that.propagateEvents)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

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

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

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

   12 | if (! ObjectUtilities.equal(this.data, that.data))
   10 | if (! ObjectUtilities.equal(this.data, that.data))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.DefaultTableXYDataset | org.jfree.data.time.TimeSeriesCollection | SUBCLASS_TYPE_MISMATCH

   10

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

   13

       return false;

   13 | return false;
   11 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   11

       return false;

   Precondition Violations (14)
   Row | Violation
   --- | ---
   1 | Unmatched return false;
   2 | Expression that.autoPrune cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression that.domainIsPointsInTime cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Unmatched return false;
   5 | Unmatched return false;
   6 | Clone fragment #1 returns variable that with type org.jfree.data.xy.DefaultTableXYDataset , while Clone fragment #2 returns variable that with type org.jfree.data.time.TimeSeriesCollection
   7 | Conditional return true;
   8 | Conditional return true;
   9 | Conditional return false;
   10 | Conditional return false;
   11 | Conditional return false;
   12 | Conditional return false;
   13 | Conditional return false;
   14 | Conditional return false;