43-17-66

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 MinMaxCategoryRenderer)) { return false; } MinMaxCategoryRenderer that = (MinMaxCategoryRenderer) obj; if (this.plotLines != that.plotLines) { return false; } if (!PaintUtilities.equal(this.groupPaint, that.groupPaint)) { return false; } if (!this.groupStroke.equals(that.groupStroke)) { return false; } return super.equals(obj);

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/MinMaxCategoryRenderer.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 DefaultTableXYDataset)) {↵

4

            if (!(obj instanceof MinMaxCategoryRenderer)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            DefaultTableXYDataset that = (DefaultTableXYDataset) obj;↵

7

            ↵

8

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

9

                return false;↵

10

            }↵

8

    MinMaxCategoryRenderer that = (MinMaxCategoryRenderer) obj;↵

11

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

9

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

12

                return false;↵

10

                return false;↵

13

            }↵

11

            }↵

14

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

12

            if (!PaintUtilities.equal(this.groupPaint, that.groupPaint)) {↵

15

                return false;↵

13

                return false;↵

16

            }↵

14

            }↵

17

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

15

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

18

                return false;↵

16

                return false;↵

19

            }↵

17

            }↵

20

            return true;

18

            return super.equals(obj);

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

1. {Non-refactorable}

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

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

   Preondition Violations

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

   3

       if (!(obj instanceof MinMaxCategoryRenderer))

   4

       return false;

   4

       return false;

   5

       MinMaxCategoryRenderer that = (MinMaxCategoryRenderer)obj;

   5

       DefaultTableXYDataset that = (DefaultTableXYDataset)obj;

   6

       if (this.autoPrune != that.autoPrune)

   6 | if (this.autoPrune != that.autoPrune)
   6 | if (this.plotLines != that.plotLines)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   autoPrune | plotLines | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.DefaultTableXYDataset | org.jfree.chart.renderer.category.MinMaxCategoryRenderer | VARIABLE_TYPE_MISMATCH
   autoPrune | plotLines | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   6

       if (this.plotLines != that.plotLines)

   7

       return false;

   7

       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 (! this.groupStroke.equals(that.groupStroke))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.DefaultTableXYDataset | org.jfree.chart.renderer.category.MinMaxCategoryRenderer | VARIABLE_TYPE_MISMATCH
   intervalDelegate | groupStroke | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.IntervalXYDelegate | java.awt.Stroke | VARIABLE_TYPE_MISMATCH
   intervalDelegate | groupStroke | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.IntervalXYDelegate | java.awt.Stroke | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   Type org.jfree.data.xy.IntervalXYDelegate of variable that.intervalDelegate does not match with type java.awt.Stroke of variable that.groupStroke
   - Make classes org.jfree.data.xy.IntervalXYDelegate and java.awt.Stroke extend a common superclass

   Type org.jfree.data.xy.IntervalXYDelegate of variable this.intervalDelegate does not match with type java.awt.Stroke of variable this.groupStroke
   - Make classes org.jfree.data.xy.IntervalXYDelegate and java.awt.Stroke extend a common superclass

   10

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

   11

       return false;

   11

       return false;

   12

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

   12 | if (! ObjectUtilities.equal(this.data, that.data))
   8 | if (! PaintUtilities.equal(this.groupPaint, that.groupPaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   data | groupPaint | VARIABLE_NAME_MISMATCH
   java.util.List | java.awt.Paint | VARIABLE_TYPE_MISMATCH
   org.jfree.util.ObjectUtilities | org.jfree.util.PaintUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.util.List of variable this.data does not match with type java.awt.Paint of variable this.groupPaint
   - Make classes java.util.List and java.awt.Paint extend a common superclass

   Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   - Make classes org.jfree.util.ObjectUtilities and org.jfree.util.PaintUtilities extend a common superclass

   8

       if (!PaintUtilities.equal(this.groupPaint, that.groupPaint))

   13

       return false;

   9

       return false;

   14

       return true;

   14 | return true;
   12 | return super.equals(obj);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   true | super.equals(obj) | TYPE_COMPATIBLE_REPLACEMENT

   12

       return super.equals(obj);

   Precondition Violations (8)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof DefaultTableXYDataset does not match with type boolean of variable obj instanceof MinMaxCategoryRenderer
   2 | Type org.jfree.data.xy.DefaultTableXYDataset of variable that does not match with type org.jfree.chart.renderer.category.MinMaxCategoryRenderer of variable that
   3 | Unmatched return false;
   4 | Type org.jfree.data.xy.DefaultTableXYDataset of variable that does not match with type org.jfree.chart.renderer.category.MinMaxCategoryRenderer of variable that
   5 | Type org.jfree.data.xy.IntervalXYDelegate of variable that.intervalDelegate does not match with type java.awt.Stroke of variable that.groupStroke
   6 | Type org.jfree.data.xy.IntervalXYDelegate of variable this.intervalDelegate does not match with type java.awt.Stroke of variable this.groupStroke
   7 | Type java.util.List of variable this.data does not match with type java.awt.Paint of variable this.groupPaint
   8 | Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities