43-24-61

if (obj == this) { return true; } if (!(obj instanceof Second)) { return false; } Second that = (Second) obj; if (this.second != that.second) { return false; } if (this.minute != that.minute) { return false; } if (this.hour != that.hour) { return false; } if (!this.day.equals(that.day)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof DefaultBoxAndWhiskerXYDataset)) { return false; } DefaultBoxAndWhiskerXYDataset that = (DefaultBoxAndWhiskerXYDataset) obj; if (!ObjectUtilities.equal(this.seriesKey, that.seriesKey)) { return false; } if (!this.dates.equals(that.dates)) { return false; } if (!this.items.equals(that.items)) { return false; } return true;

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

4

            if (!(obj instanceof DefaultBoxAndWhiskerXYDataset)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            Second that = (Second) obj;↵

7

            ↵

8

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

8

    DefaultBoxAndWhiskerXYDataset that ↵

9

                return false;↵

9

                ↵

10

            }↵

11

            if (this.minute != that.minute↵

10

        = (DefaultBoxAndWhiskerXYDataset) obj;↵

12

    ) {↵

11

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

13

                return false;↵

12

                return false;↵

14

            }↵

13

            }↵

15

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

14

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

16

                return false;↵

15

                return false;↵

17

            }↵

16

            }↵

18

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

17

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

19

                return false;↵

18

                return false;↵

20

            }↵

19

            }↵

21

            return true;

20

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

1. {Non-refactorable}

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

   3 | if (!(obj instanceof Second))
   3 | if (!(obj instanceof DefaultBoxAndWhiskerXYDataset))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.Second | org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof Second does not match with type boolean of variable obj instanceof DefaultBoxAndWhiskerXYDataset
   - Make classes org.jfree.data.time.Second and org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset extend a common superclass

   3

       if (!(obj instanceof DefaultBoxAndWhiskerXYDataset))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       DefaultBoxAndWhiskerXYDataset that = (DefaultBoxAndWhiskerXYDataset)obj;

   5

       Second that = (Second)obj;

   6

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

   7 | return false;

   Preondition Violations
   Unmatched return false;

   7

       return false;

   6

       if (this.second != that.second)

   7

       return false;

   7 | return false;

   Preondition Violations
   Unmatched return false;

   8

       if (this.minute != that.minute)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

       if (this.hour != that.hour)

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

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

   12 | if (! this.day.equals(that.day))
   8 | if (! this.dates.equals(that.dates))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.Second | org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset | VARIABLE_TYPE_MISMATCH
   day | dates | VARIABLE_NAME_MISMATCH
   org.jfree.data.time.Day | java.util.List | VARIABLE_TYPE_MISMATCH
   day | dates | VARIABLE_NAME_MISMATCH
   org.jfree.data.time.Day | java.util.List | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.time.Second of variable that does not match with type org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset of variable that
   - Make classes org.jfree.data.time.Second and org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset extend a common superclass

   Type org.jfree.data.time.Day of variable that.day does not match with type java.util.List of variable that.dates
   - Make classes org.jfree.data.time.Day and java.util.List extend a common superclass

   Type org.jfree.data.time.Day of variable this.day does not match with type java.util.List of variable this.dates
   - Make classes org.jfree.data.time.Day and java.util.List extend a common superclass

   8

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

   13

       return false;

   13 | return false;
   9 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   9

       return false;

   Precondition Violations (14)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof Second does not match with type boolean of variable obj instanceof DefaultBoxAndWhiskerXYDataset
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Unmatched return false;
   6 | Type org.jfree.data.time.Second of variable that does not match with type org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset of variable that
   7 | Type org.jfree.data.time.Day of variable that.day does not match with type java.util.List of variable that.dates
   8 | Type org.jfree.data.time.Day of variable this.day does not match with type java.util.List of variable this.dates
   9 | Conditional return true;
   10 | Conditional return true;
   11 | Conditional return false;
   12 | Conditional return false;
   13 | Conditional return false;
   14 | Conditional return false;