43-17-99

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 StackedBarRenderer3D)) { return false; } if (!super.equals(obj)) { return false; } StackedBarRenderer3D that = (StackedBarRenderer3D) obj; if (this.renderAsPercentages != that.getRenderAsPercentages()) { 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/chart/renderer/category/StackedBarRenderer3D.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 DefaultTableXYDataset)) {↵

4

            if (!(obj instanceof StackedBarRenderer3D)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            DefaultTableXYDataset that = (DefaultTableXYDataset) obj;↵

7

            ↵

8

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

9

                return false;↵

10

            }↵

11

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

12

                return false;↵

13

            }↵

8

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

9

                return false;↵

10

            }↵

11

            StackedBarRenderer3D that = (StackedBarRenderer3D) obj;↵

14

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

12

            if (this.↵

15

                return false;↵

16

            }↵

17

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

13

    renderAsPercentages != that.getRenderAsPercentages()) {↵

18

                return false;↵

14

                return false;↵

19

            }↵

15

            }↵

20

            return true;

16

            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) | 0.9
Clones location | Clones are in different classes
Number of node comparisons | 58

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 9
   Number of unmapped statements in the first code fragment | 5
   Number of unmapped statements in the second code fragment | 1
   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;

   3

       if (!(obj instanceof DefaultTableXYDataset))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.DefaultTableXYDataset | org.jfree.chart.renderer.category.StackedBarRenderer3D | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof DefaultTableXYDataset does not match with type boolean of variable obj instanceof StackedBarRenderer3D
   - Make classes org.jfree.data.xy.DefaultTableXYDataset and org.jfree.chart.renderer.category.StackedBarRenderer3D extend a common superclass

   3

       if (!(obj instanceof StackedBarRenderer3D))

   4

       return false;

   4

       return false;

   5

       DefaultTableXYDataset that = (DefaultTableXYDataset)obj;

   6

       if (this.autoPrune != that.autoPrune)

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   autoPrune | renderAsPercentages | VARIABLE_NAME_MISMATCH
   that.autoPrune | that.getRenderAsPercentages() | TYPE_COMPATIBLE_REPLACEMENT

   8

       if (this.renderAsPercentages != that.getRenderAsPercentages())

   7

       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))
   5 | if (! super.equals(obj))

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

   5

       if (!super.equals(obj))

   11

       return false;

   6

       return false;

   7

       StackedBarRenderer3D that = (StackedBarRenderer3D)obj;

   12

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

   13

       return false;

   13 | return false;

   Preondition Violations
   Unmatched return false;

   14

       return true;

   10

       return true;

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