43-17-30

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 DefaultIntervalCategoryDataset)) { return false; } DefaultIntervalCategoryDataset that = (DefaultIntervalCategoryDataset) obj; if (!Arrays.equals(this.seriesKeys, that.seriesKeys)) { return false; } if (!Arrays.equals(this.categoryKeys, that.categoryKeys)) { return false; } if (!equal(this.startData, that.startData)) { return false; } if (!equal(this.endData, that.endData)) { return false; } // seem to be the same... 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/category/DefaultIntervalCategoryDataset.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 14 |  | Number of AST nodes: 14

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 DefaultIntervalCategoryDataset)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            DefaultTableXYDataset that = (DefaultTableXYDataset) obj;↵

7

            Default↵

8

            if (this.autoPrune != that.autoPrune↵

8

    IntervalCategoryDataset that ↵

9

                    = (DefaultIntervalCategoryDataset) obj;↵

9

    ) {↵

10

            if (!Arrays.equals(this.seriesKeys, that.seriesKeys)) {↵

10

                return false;↵

11

                return false;↵

11

            }↵

12

            }↵

12

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

13

            if (!Arrays.equals(this.categoryKeys, that.categoryKeys)) {↵

13

                return false;↵

14

                return false;↵

14

            }↵

15

            }↵

15

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

16

            if (!equal(this.startData, that.startData)) {↵

16

                return false;↵

17

                return false;↵

17

            }↵

18

            }↵

18

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

19

            if (!equal(this.endData, that.endData)) {↵

19

                return false;↵

20

                return false;↵

20

            }↵

21

            }↵

22

            // seem to be the same...↵

21

            return true;

23

            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.8
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 55

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 7
   Number of unmapped statements in the first code fragment | 4
   Number of unmapped statements in the second code fragment | 4
   Time elapsed for statement mapping (ms) | 7.6
   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 DefaultIntervalCategoryDataset))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.DefaultTableXYDataset | org.jfree.data.category.DefaultIntervalCategoryDataset | SUBCLASS_TYPE_MISMATCH

   3

       if (!(obj instanceof DefaultIntervalCategoryDataset))

   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 | DefaultIntervalCategoryDataset that = (DefaultIntervalCategoryDataset)obj;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.DefaultTableXYDataset | org.jfree.data.category.DefaultIntervalCategoryDataset | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.DefaultTableXYDataset | org.jfree.data.category.DefaultIntervalCategoryDataset | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.DefaultTableXYDataset | org.jfree.data.category.DefaultIntervalCategoryDataset | SUBCLASS_TYPE_MISMATCH

   5

       DefaultIntervalCategoryDataset that = (DefaultIntervalCategoryDataset)obj;

   6

       if (!Arrays.equals(this.seriesKeys, that.seriesKeys))

   7 | return false;

   Preondition Violations
   Unmatched return false;

   7

       return false;

   6

       if (this.autoPrune != that.autoPrune)

   7

       return false;

   7 | return false;

   Preondition Violations
   Unmatched return false;

   8

       if (!Arrays.equals(this.categoryKeys, that.categoryKeys))

   9 | return false;

   Preondition Violations
   Unmatched 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))

   10 | if (! this.intervalDelegate.equals(that.intervalDelegate))
   10 | if (! equal(this.startData, that.startData))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   equals | equal | METHOD_INVOCATION_NAME_MISMATCH
   this.intervalDelegate.equals(that.intervalDelegate) | equal(this.startData,that.startData) | ARGUMENT_NUMBER_MISMATCH
   this.intervalDelegate |  | MISSING_METHOD_INVOCATION_EXPRESSION

   Preondition Violations
   Expression this.intervalDelegate.equals(that.intervalDelegate) cannot be parameterized, because it has dependencies to/from statements that will be extracted

   Expression equal(this.startData,that.startData) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   - Inline private method equal

   Expression this.intervalDelegate.equals(that.intervalDelegate) cannot be parameterized, because it has dependencies to/from statements that will be extracted

   Expression equal(this.startData,that.startData) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   - Inline private method equal

   10

       if (!equal(this.startData, that.startData))

   11

       return false;

   11 | return false;
   11 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   11

       return false;

   Precondition Violations (15)
   Row | Violation
   --- | ---
   1 | Unmatched return false;
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Expression this.intervalDelegate.equals(that.intervalDelegate) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   6 | Expression equal(this.startData,that.startData) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   7 | Expression this.intervalDelegate.equals(that.intervalDelegate) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   8 | Expression equal(this.startData,that.startData) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   9 | 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.category.DefaultIntervalCategoryDataset
   10 | Conditional return true;
   11 | Conditional return true;
   12 | Conditional return false;
   13 | Conditional return false;
   14 | Conditional return false;
   15 | Conditional return false;