43-17-102

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 StatisticalBarRenderer)) { return false; } StatisticalBarRenderer that = (StatisticalBarRenderer) obj; if (!PaintUtilities.equal(this.errorIndicatorPaint, that.errorIndicatorPaint)) { return false; } if (!ObjectUtilities.equal(this.errorIndicatorStroke, that.errorIndicatorStroke)) { 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/StatisticalBarRenderer.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 StatisticalBarRenderer)) {↵

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

            }↵

14

            if (!this.intervalDeleg↵

8

    StatisticalBarRenderer that = (StatisticalBarRenderer) obj;↵

9

            if (!PaintUtilities.equal(this.errorIndicatorPaint,↵

15

    ate.equals(that.intervalDelegate)) {↵

10

                    that.errorIndicatorPaint)) {↵

16

                return false;↵

11

                return false;↵

17

            }↵

12

            }↵

18

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

13

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

19

    )) {↵

14

                    that.errorIndicatorStroke)) {↵

20

                return false;↵

15

                return false;↵

21

            }↵

16

            }↵

22

            return true;

17

            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.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 DefaultTableXYDataset))

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

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

   Preondition Violations

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

   3

       if (!(obj instanceof StatisticalBarRenderer))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       StatisticalBarRenderer that = (StatisticalBarRenderer)obj;

   5

       DefaultTableXYDataset that = (DefaultTableXYDataset)obj;

   6

       if (this.autoPrune != that.autoPrune)

   7

       return false;

   7 | return false;

   Preondition Violations
   Unmatched 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))

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

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

   12 | if (! ObjectUtilities.equal(this.data, that.data))
   6 | if (! PaintUtilities.equal(this.errorIndicatorPaint, that.errorIndicatorPaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   data | errorIndicatorPaint | 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.errorIndicatorPaint
   - 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

   6

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

   13

       return false;

   13 | return false;
   7 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   7

       return false;

   Precondition Violations (12)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof DefaultTableXYDataset does not match with type boolean of variable obj instanceof StatisticalBarRenderer
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Type java.util.List of variable this.data does not match with type java.awt.Paint of variable this.errorIndicatorPaint
   6 | Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   7 | Conditional return true;
   8 | Conditional return true;
   9 | Conditional return false;
   10 | Conditional return false;
   11 | Conditional return false;
   12 | Conditional return false;