43-15-89

if (obj == this) { return true; } if (!(obj instanceof DateAxis)) { return false; } DateAxis that = (DateAxis) obj; if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) { return false; } if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride)) { return false; } if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition)) { return false; } if (!ObjectUtilities.equal(this.timeline, that.timeline)) { return false; } if (!super.equals(obj)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof TaskSeries)) { return false; } if (!super.equals(obj)) { return false; } TaskSeries that = (TaskSeries) obj; if (!this.tasks.equals(that.tasks)) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/DateAxis.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/gantt/TaskSeries.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 16 |  | Number of AST nodes: 10

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof DateAxis)) {↵

4

            if (!(obj instanceof TaskSeries)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            DateAxis that = (DateAxis) obj;↵

7

            ↵

8

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

8

    if (!super.equals(obj)) {↵

9

                return false;↵

9

                return false;↵

10

            }↵

10

            }↵

11

            if (!ObjectUtilities.equal(this.dateFormatOverride,↵

11

            ↵

12

                    that.dateFormatOverride)) {↵

13

                return false;↵

14

            }↵

15

            if (!ObjectUtilities.equal(this.tickMarkPosition,↵

16

                    that.tickMarkPosition)) {↵

17

                return false;↵

18

            }↵

19

            if (!ObjectUtilitie↵

12

    TaskSeries that = (TaskSeries) obj;↵

20

    s.equal(this.timeline, that.timeline)) {↵

13

            if (!this.tasks.equals(th↵

21

                return false;↵

22

            }↵

23

            if (!super.equals(obj)) {↵

14

    at.tasks)) {↵

24

                return false;↵

15

                return false;↵

25

            }↵

16

            }↵

26

            return true;

17

            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
Number of node comparisons | 62

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 9
   Number of unmapped statements in the first code fragment | 7
   Number of unmapped statements in the second code fragment | 1
   Time elapsed for statement mapping (ms) | 2.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;

   3

       if (!(obj instanceof DateAxis))

   3 | if (!(obj instanceof DateAxis))
   3 | if (!(obj instanceof TaskSeries))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.axis.DateAxis | org.jfree.data.gantt.TaskSeries | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof DateAxis does not match with type boolean of variable obj instanceof TaskSeries
   - Make classes org.jfree.chart.axis.DateAxis and org.jfree.data.gantt.TaskSeries extend a common superclass

   3

       if (!(obj instanceof TaskSeries))

   4

       return false;

   4

       return false;

   5

       DateAxis that = (DateAxis)obj;

   6

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

   6 | if (! ObjectUtilities.equal(this.tickUnit, that.tickUnit))
   5 | if (! super.equals(obj))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   ObjectUtilities.equal(this.tickUnit,that.tickUnit) | super.equals(obj) | TYPE_COMPATIBLE_REPLACEMENT

   5

       if (!super.equals(obj))

   7

       return false;

   6

       return false;

   7

       TaskSeries that = (TaskSeries)obj;

   8

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

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

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

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

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

   13

       return false;

   13 | return false;

   Preondition Violations
   Unmatched return false;

   14

       if (!super.equals(obj))

   14 | if (! super.equals(obj))
   8 | if (! this.tasks.equals(that.tasks))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   super.equals(obj) | this.tasks.equals(that.tasks) | TYPE_COMPATIBLE_REPLACEMENT

   8

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

   15

       return false;

   9

       return false;

   16

       return true;

   10

       return true;

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof DateAxis does not match with type boolean of variable obj instanceof TaskSeries
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;