43-140-150

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 == this) { return true; } if (!(obj instanceof XYSeries)) { return false; } if (!super.equals(obj)) { return false; } XYSeries that = (XYSeries) obj; if (this.maximumItemCount != that.maximumItemCount) { return false; } if (this.autoSort != that.autoSort) { return false; } if (this.allowDuplicateXValues != that.allowDuplicateXValues) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { 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/data/xy/XYSeries.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 14 |  | Number of AST nodes: 16

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof CombinedDomainCategoryPlot)) {↵

4

            if (!(obj instanceof XYSeries)) {↵

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

            CombinedDomainCategoryPlot plot = (CombinedDomainCategoryPlot) obj;↵

10

            ↵

11

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

11

    XYSeries that = (XYSeries) obj;↵

12

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

13

                return false;↵

14

            }↵

12

    ) {↵

15

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

13

                return false;↵

16

                return false;↵

14

            }↵

17

            }↵

15

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

18

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

16

                return false;↵

19

                return false;↵

17

            }↵

20

            }↵

18

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

21

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

19

                return false;↵

22

                return false;↵

20

            }↵

23

            }↵

21

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 10
   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) | 1.2
   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 CombinedDomainCategoryPlot))

   3 | if (!(obj instanceof CombinedDomainCategoryPlot))
   3 | if (!(obj instanceof XYSeries))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.CombinedDomainCategoryPlot | org.jfree.data.xy.XYSeries | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof CombinedDomainCategoryPlot does not match with type boolean of variable obj instanceof XYSeries
   - Make classes org.jfree.chart.plot.CombinedDomainCategoryPlot and org.jfree.data.xy.XYSeries extend a common superclass

   3

       if (!(obj instanceof XYSeries))

   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

       XYSeries that = (XYSeries)obj;

   7

       CombinedDomainCategoryPlot plot = (CombinedDomainCategoryPlot)obj;

   10

       if (this.autoSort != that.autoSort)

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   12

       if (this.allowDuplicateXValues != that.allowDuplicateXValues)

   13 | return false;

   Preondition Violations
   Unmatched return false;

   13

       return false;

   8

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

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   subplots | data | VARIABLE_NAME_MISMATCH
   plot | that | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.CombinedDomainCategoryPlot | org.jfree.data.xy.XYSeries | VARIABLE_TYPE_MISMATCH
   subplots | data | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.CombinedDomainCategoryPlot of variable plot does not match with type org.jfree.data.xy.XYSeries of variable that
   - Make classes org.jfree.chart.plot.CombinedDomainCategoryPlot and org.jfree.data.xy.XYSeries extend a common superclass

   14

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

   9

       return false;

   9 | return false;
   15 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   15

       return false;

   10

       if (this.totalWeight != plot.totalWeight)

   10 | if (this.totalWeight != plot.totalWeight)
   8 | if (this.maximumItemCount != that.maximumItemCount)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   totalWeight | maximumItemCount | VARIABLE_NAME_MISMATCH
   plot | that | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.CombinedDomainCategoryPlot | org.jfree.data.xy.XYSeries | VARIABLE_TYPE_MISMATCH
   totalWeight | maximumItemCount | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.CombinedDomainCategoryPlot of variable plot does not match with type org.jfree.data.xy.XYSeries of variable that
   - Make classes org.jfree.chart.plot.CombinedDomainCategoryPlot and org.jfree.data.xy.XYSeries extend a common superclass

   8

       if (this.maximumItemCount != that.maximumItemCount)

   11

       return false;

   11 | return false;
   9 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   9

       return false;

   Precondition Violations (15)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof CombinedDomainCategoryPlot does not match with type boolean of variable obj instanceof XYSeries
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Type org.jfree.chart.plot.CombinedDomainCategoryPlot of variable plot does not match with type org.jfree.data.xy.XYSeries of variable that
   5 | Type org.jfree.chart.plot.CombinedDomainCategoryPlot of variable plot does not match with type org.jfree.data.xy.XYSeries of variable that
   6 | Conditional return true;
   7 | Conditional return true;
   8 | Conditional return false;
   9 | Conditional return false;
   10 | Conditional return false;
   11 | Conditional return false;
   12 | Conditional return false;
   13 | Conditional return false;
   14 | Conditional return false;
   15 | Conditional return false;