43-140-152

if (obj == this) { return true; } if (!(obj instanceof CombinedDomainCategoryPlot)) { return false; } if (!super.equals(obj)) { return false; } CombinedDomainCategoryPlot plot = (CombinedDomainCategoryPlot) obj; if (!ObjectUtilities.equal(this.subplots, plot.subplots)) { return false; } if (this.totalWeight != plot.totalWeight) { return false; } if (this.gap != plot.gap) { 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/plot/CombinedDomainCategoryPlot.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: 14 |  | 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 CombinedDomainCategoryPlot)) {↵

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

            CombinedDomainCategoryPlot plot = (CombinedDomainCategoryPlot) obj;↵

13

            CombinedDomainXYPlot p = (CombinedDomainXYPlot) obj;↵

11

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

14

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

12

                return false;↵

15

                return false;↵

13

            }↵

16

            }↵

14

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

17

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

15

                return false;↵

18

                return false;↵

16

            }↵

19

            }↵

17

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

20

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

18

                return false;↵

21

                return false;↵

19

            }↵

22

            }↵

20

            return true;

23

            return true;

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.5
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 109

1. {Refactorable}

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

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

   1

       if (obj == this)

   3

       if (obj == this)

   2

       return true;

   4

       return true;

   3

       if (!(obj instanceof CombinedDomainCategoryPlot))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.CombinedDomainCategoryPlot | org.jfree.chart.plot.CombinedDomainXYPlot | SUBCLASS_TYPE_MISMATCH

   5

       if (!(obj instanceof CombinedDomainXYPlot))

   4

       return false;

   6

       return false;

   5

       if (!super.equals(obj))

   7

       if (!super.equals(obj))

   6

       return false;

   8

       return false;

   7

       CombinedDomainCategoryPlot plot = (CombinedDomainCategoryPlot)obj;

   7 | CombinedDomainCategoryPlot plot = (CombinedDomainCategoryPlot)obj;
   9 | CombinedDomainXYPlot p = (CombinedDomainXYPlot)obj;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.CombinedDomainCategoryPlot | org.jfree.chart.plot.CombinedDomainXYPlot | SUBCLASS_TYPE_MISMATCH
   plot | p | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.CombinedDomainCategoryPlot | org.jfree.chart.plot.CombinedDomainXYPlot | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.plot.CombinedDomainCategoryPlot | org.jfree.chart.plot.CombinedDomainXYPlot | SUBCLASS_TYPE_MISMATCH

   9

       CombinedDomainXYPlot p = (CombinedDomainXYPlot)obj;

   8

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

   8 | if (! ObjectUtilities.equal(this.subplots, plot.subplots))
   14 | if (! ObjectUtilities.equal(this.subplots, p.subplots))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   plot | p | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.CombinedDomainCategoryPlot | org.jfree.chart.plot.CombinedDomainXYPlot | SUBCLASS_TYPE_MISMATCH

   14

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

   9

       return false;

   15

       return false;

   10

       if (this.totalWeight != plot.totalWeight)

   10 | if (this.totalWeight != plot.totalWeight)
   10 | if (this.totalWeight != p.totalWeight)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   plot | p | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.CombinedDomainCategoryPlot | org.jfree.chart.plot.CombinedDomainXYPlot | SUBCLASS_TYPE_MISMATCH

   10

       if (this.totalWeight != p.totalWeight)

   11

       return false;

   11

       return false;

   12

       if (this.gap != plot.gap)

   12 | if (this.gap != plot.gap)
   12 | if (this.gap != p.gap)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   plot | p | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.CombinedDomainCategoryPlot | org.jfree.chart.plot.CombinedDomainXYPlot | SUBCLASS_TYPE_MISMATCH

   12

       if (this.gap != p.gap)

   13

       return false;

   13

       return false;

   14

       return true;

   16

       return true;

   Precondition Violations (0)
   Row | Violation
   --- | ---