43-139-142

if (obj == this) { return true; } if (!(obj instanceof StandardXYZToolTipGenerator)) { return false; } if (!super.equals(obj)) { return false; } StandardXYZToolTipGenerator that = (StandardXYZToolTipGenerator) obj; if (!ObjectUtilities.equal(this.zFormat, that.zFormat)) { return false; } if (!ObjectUtilities.equal(this.zDateFormat, that.zDateFormat)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof CombinedRangeCategoryPlot)) { return false; } if (!super.equals(obj)) { return false; } CombinedRangeCategoryPlot that = (CombinedRangeCategoryPlot) obj; if (!ObjectUtilities.equal(this.subplots, that.subplots)) { return false; } if (this.totalWeight != that.totalWeight) { return false; } if (this.gap != that.gap) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/labels/StandardXYZToolTipGenerator.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeCategoryPlot.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 12 |  | Number of AST nodes: 14

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof StandardXYZToolTipGenerator)) {↵

4

            if (!(obj instanceof CombinedRangeCategoryPlot)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

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

7

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

8

                return false;↵

8

                return false;↵

9

            }↵

9

            }↵

10

            StandardXYZToolTipGenerator that = (StandardXYZToolTipGenerator) obj;↵

10

            CombinedRangeCategoryPlot that = (CombinedRangeCategoryPlot) obj;↵

11

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

11

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

12

                return false;↵

12

                return false;↵

13

            }↵

13

            }↵

14

            if (!ObjectUtilities.equal(this.zDateFormat, that.zDateFormat)↵

14

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

15

                return false;↵

16

            }↵

15

    ) {↵

17

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

16

                return false;↵

18

                return false;↵

17

            }↵

19

            }↵

18

            return true;

20

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 8
   Number of unmapped statements in the first code fragment | 1
   Number of unmapped statements in the second code fragment | 1
   Time elapsed for statement mapping (ms) | 0.7
   Clone type | Type 2

   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 StandardXYZToolTipGenerator))

   3 | if (!(obj instanceof StandardXYZToolTipGenerator))
   3 | if (!(obj instanceof CombinedRangeCategoryPlot))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.labels.StandardXYZToolTipGenerator | org.jfree.chart.plot.CombinedRangeCategoryPlot | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof StandardXYZToolTipGenerator does not match with type boolean of variable obj instanceof CombinedRangeCategoryPlot
   - Make classes org.jfree.chart.labels.StandardXYZToolTipGenerator and org.jfree.chart.plot.CombinedRangeCategoryPlot extend a common superclass

   3

       if (!(obj instanceof CombinedRangeCategoryPlot))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       if (!super.equals(obj))

   5

       if (!super.equals(obj))

   6

       return false;

   6 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

   7

       CombinedRangeCategoryPlot that = (CombinedRangeCategoryPlot)obj;

   7

       StandardXYZToolTipGenerator that = (StandardXYZToolTipGenerator)obj;

   8

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

   8 | if (! ObjectUtilities.equal(this.zFormat, that.zFormat))
   8 | if (! ObjectUtilities.equal(this.subplots, that.subplots))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   zFormat | subplots | VARIABLE_NAME_MISMATCH
   java.text.NumberFormat | java.util.List | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.text.NumberFormat of variable this.zFormat does not match with type java.util.List of variable this.subplots
   - Make classes java.text.NumberFormat and java.util.List extend a common superclass

   8

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

   9

       return false;

   9 | return false;
   9 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   9

       return false;

   Precondition Violations (10)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof StandardXYZToolTipGenerator does not match with type boolean of variable obj instanceof CombinedRangeCategoryPlot
   2 | Type java.text.NumberFormat of variable this.zFormat does not match with type java.util.List of variable this.subplots
   3 | Conditional return true;
   4 | Conditional return true;
   5 | Conditional return false;
   6 | Conditional return false;
   7 | Conditional return false;
   8 | Conditional return false;
   9 | Conditional return false;
   10 | Conditional return false;