43-139-152

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 == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof CombinedDomainXYPlot)) { return false; } if (!super.equals(obj)) { return false; } CombinedDomainXYPlot p = (CombinedDomainXYPlot) obj; if (this.totalWeight != p.totalWeight) { return false; } if (this.gap != p.gap) { return false; } if (!ObjectUtilities.equal(this.subplots, p.subplots)) { 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/CombinedDomainXYPlot.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 12 |  | Number of AST nodes: 16

1

    if (obj == null) {↵

2

                return false;↵

3

            }↵

1

    if (obj == this) {↵

4

            if (obj == this) {↵

2

                return true;↵

5

                return true;↵

3

            }↵

6

            }↵

4

            if (!(obj instanceof StandardXYZToolTipGenerator)) {↵

7

            if (!(obj instanceof CombinedDomainXYPlot)) {↵

5

                return false;↵

8

                return false;↵

6

            }↵

9

            }↵

7

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

10

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

8

                return false;↵

11

                return false;↵

9

            }↵

12

            }↵

10

            StandardXYZToolTipGenerator that = (StandardXYZToolTipGenerator) obj;↵

13

            ↵

11

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

14

    CombinedDomainXYPlot p = (CombinedDomainXYPlot) obj;↵

15

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

16

                return false;↵

17

            }↵

12

    ) {↵

18

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

13

                return false;↵

19

                return false;↵

14

            }↵

20

            }↵

15

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

21

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

16

                return false;↵

22

                return false;↵

17

            }↵

23

            }↵

18

            return true;

24

            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 | 66

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 | 5
   Time elapsed for statement mapping (ms) | 0.7
   Clone type | Type 3

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   1

       if (obj == this)

   3

       if (obj == this)

   2

       return true;

   2 | return true;
   4 | return true;

   Preondition Violations
   Conditional return true;
   Conditional return true;

   4

       return true;

   3

       if (!(obj instanceof StandardXYZToolTipGenerator))

   3 | if (!(obj instanceof StandardXYZToolTipGenerator))
   5 | if (!(obj instanceof CombinedDomainXYPlot))

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

   Preondition Violations

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

   5

       if (!(obj instanceof CombinedDomainXYPlot))

   4

       return false;

   4 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

   5

       if (!super.equals(obj))

   7

       if (!super.equals(obj))

   6

       return false;

   6 | return false;
   8 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   8

       return false;

   7

       StandardXYZToolTipGenerator that = (StandardXYZToolTipGenerator)obj;

   9

       CombinedDomainXYPlot p = (CombinedDomainXYPlot)obj;

   10

       if (this.totalWeight != p.totalWeight)

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   12

       if (this.gap != p.gap)

   13 | return false;

   Preondition Violations
   Unmatched return false;

   13

       return false;

   8

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

   8 | if (! ObjectUtilities.equal(this.zFormat, that.zFormat))
   14 | if (! ObjectUtilities.equal(this.subplots, p.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

   14

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

   9

       return false;

   9 | return false;
   15 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   15

       return false;

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