43-23-84

if (obj == this) { return true; } if (!(obj instanceof TimeTableXYDataset)) { return false; } TimeTableXYDataset that = (TimeTableXYDataset) obj; if (this.domainIsPointsInTime != that.domainIsPointsInTime) { return false; } if (this.xPosition != that.xPosition) { return false; } if (!this.workingCalendar.getTimeZone().equals( that.workingCalendar.getTimeZone()) ) { return false; } if (!this.values.equals(that.values)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof BlockBorder)) { return false; } BlockBorder that = (BlockBorder) obj; if (!this.insets.equals(that.insets)) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/time/TimeTableXYDataset.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/block/BlockBorder.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 14 |  | 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 TimeTableXYDataset)) {↵

4

            if (!(obj instanceof BlockBorder)) {↵

5

                return false;↵

5

                return false;   ↵

6

            }↵

6

            }↵

7

            TimeTableXYDataset that = (TimeTableXYDataset) obj;↵

7

            BlockBorder that = (BlockBorder) obj;↵

8

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

8

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

9

                return false;↵

9

                return false;   ↵

10

            }↵

10

            }↵

11

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

11

            if (↵

12

                return false;↵

13

            }↵

14

            if (!this.workingCalendar.getTimeZone().equals(↵

15

                that.workingCalendar.getTimeZone())↵

16

            ) {↵

17

                return false;↵

18

            }↵

19

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

12

    !PaintUtilities.equal(this.paint, that.paint)) {↵

20

                return false;↵

13

                return false;↵

21

            }↵

14

            }↵

22

            return true;

15

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

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 | 1
   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 TimeTableXYDataset))

   3 | if (!(obj instanceof TimeTableXYDataset))
   3 | if (!(obj instanceof BlockBorder))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.TimeTableXYDataset | org.jfree.chart.block.BlockBorder | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof TimeTableXYDataset does not match with type boolean of variable obj instanceof BlockBorder
   - Make classes org.jfree.data.time.TimeTableXYDataset and org.jfree.chart.block.BlockBorder extend a common superclass

   3

       if (!(obj instanceof BlockBorder))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       BlockBorder that = (BlockBorder)obj;

   5

       TimeTableXYDataset that = (TimeTableXYDataset)obj;

   6

       if (this.domainIsPointsInTime != that.domainIsPointsInTime)

   7

       return false;

   7 | return false;

   Preondition Violations
   Unmatched return false;

   8

       if (this.xPosition != that.xPosition)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

       if (!this.workingCalendar.getTimeZone().equals(that.workingCalendar.getTimeZone()))

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

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

   12 | if (! this.values.equals(that.values))
   6 | if (! this.insets.equals(that.insets))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.TimeTableXYDataset | org.jfree.chart.block.BlockBorder | VARIABLE_TYPE_MISMATCH
   values | insets | VARIABLE_NAME_MISMATCH
   org.jfree.data.DefaultKeyedValues2D | org.jfree.ui.RectangleInsets | VARIABLE_TYPE_MISMATCH
   values | insets | VARIABLE_NAME_MISMATCH
   org.jfree.data.DefaultKeyedValues2D | org.jfree.ui.RectangleInsets | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.time.TimeTableXYDataset of variable that does not match with type org.jfree.chart.block.BlockBorder of variable that
   - Make classes org.jfree.data.time.TimeTableXYDataset and org.jfree.chart.block.BlockBorder extend a common superclass

   Type org.jfree.data.DefaultKeyedValues2D of variable that.values does not match with type org.jfree.ui.RectangleInsets of variable that.insets
   - Make classes org.jfree.data.DefaultKeyedValues2D and org.jfree.ui.RectangleInsets extend a common superclass

   Type org.jfree.data.DefaultKeyedValues2D of variable this.values does not match with type org.jfree.ui.RectangleInsets of variable this.insets
   - Make classes org.jfree.data.DefaultKeyedValues2D and org.jfree.ui.RectangleInsets extend a common superclass

   6

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

   13

       return false;

   13 | return false;
   7 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   7

       return false;

   Precondition Violations (13)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof TimeTableXYDataset does not match with type boolean of variable obj instanceof BlockBorder
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Type org.jfree.data.time.TimeTableXYDataset of variable that does not match with type org.jfree.chart.block.BlockBorder of variable that
   6 | Type org.jfree.data.DefaultKeyedValues2D of variable that.values does not match with type org.jfree.ui.RectangleInsets of variable that.insets
   7 | Type org.jfree.data.DefaultKeyedValues2D of variable this.values does not match with type org.jfree.ui.RectangleInsets of variable this.insets
   8 | Conditional return true;
   9 | Conditional return true;
   10 | Conditional return false;
   11 | Conditional return false;
   12 | Conditional return false;
   13 | Conditional return false;