43-152-153

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;
if (obj == this) { return true; } if (!(obj instanceof NumberAxis)) { return false; } if (!super.equals(obj)) { return false; } NumberAxis that = (NumberAxis) obj; if (this.autoRangeIncludesZero != that.autoRangeIncludesZero) { return false; } if (this.autoRangeStickyZero != that.autoRangeStickyZero) { return false; } if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) { return false; } if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride)) { return false; } if (!this.rangeType.equals(that.rangeType)) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainXYPlot.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/NumberAxis.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 16 |  | Number of AST nodes: 18

1

    if (obj == null) {↵

2

                return false;↵

3

            }↵

4

            if (obj == this) {↵

1

    if (obj == this) {↵

5

                return true;↵

2

                return true;↵

6

            }↵

3

            }↵

7

            if (!(obj instanceof CombinedDomainXYPlot)) {↵

4

            if (!(obj instanceof NumberAxis)) {↵

8

                return false;↵

5

                return false;↵

9

            }↵

6

            }↵

10

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

7

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

11

                return false;↵

8

                return false;↵

12

            }↵

9

            }↵

13

            CombinedDomainXYPlot p = (CombinedDomainXYPlot) obj;↵

10

            NumberAxis that = (NumberAxis) obj;↵

14

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

11

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

15

                return false;↵

12

                return false;↵

16

            }↵

13

            }↵

17

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

14

            if (this.↵

18

                return false;↵

19

            }↵

20

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

21

                return false;↵

22

            }↵

15

    autoRangeStickyZero != that.autoRangeStickyZero) {↵

16

                return false;↵

17

            }↵

18

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

19

                return false;↵

20

            }↵

21

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

22

                    that.numberFormatOverride)) {↵

23

                return false;↵

24

            }↵

25

            if (!this.rangeType.equals(that.rangeType)) {↵

26

                return false;↵

27

            }↵

23

            return true;

28

            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) | 2.4
Clones location | Clones are in different classes
Number of node comparisons | 87

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 8
   Number of unmapped statements in the first code fragment | 7
   Number of unmapped statements in the second code fragment | 5
   Time elapsed for statement mapping (ms) | 1.0
   Clone type | Type 3

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

   1

       if (obj == null)

   1 | if (obj == null)
   1 | if (obj == this)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   null | this | TYPE_COMPATIBLE_REPLACEMENT

   1

       if (obj == this)

   2

       return false;

   2 | return false;
   2 | return true;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   false | true | LITERAL_VALUE_MISMATCH

   Preondition Violations
   Conditional return false;
   Conditional return true;

   2

       return true;

   3

       if (obj == this)

   4

       return true;

   4 | return true;

   Preondition Violations
   Unmatched return true;

   5

       if (!(obj instanceof CombinedDomainXYPlot))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.CombinedDomainXYPlot | org.jfree.chart.axis.NumberAxis | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof NumberAxis))

   6

       return false;

   6 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   7

       if (!super.equals(obj))

   5

       if (!super.equals(obj))

   8

       return false;

   8 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

   7

       NumberAxis that = (NumberAxis)obj;

   8

       if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   9

       CombinedDomainXYPlot p = (CombinedDomainXYPlot)obj;

   10

       if (this.autoRangeStickyZero != that.autoRangeStickyZero)

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   10

       if (this.totalWeight != p.totalWeight)

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

       if (this.gap != p.gap)

   13

       return false;

   13 | return false;

   Preondition Violations
   Unmatched return false;

   14

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

   14 | if (! ObjectUtilities.equal(this.subplots, p.subplots))
   12 | if (! ObjectUtilities.equal(this.tickUnit, that.tickUnit))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   subplots | tickUnit | VARIABLE_NAME_MISMATCH
   java.util.List | org.jfree.chart.axis.NumberTickUnit | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.util.List of variable this.subplots does not match with type org.jfree.chart.axis.NumberTickUnit of variable this.tickUnit
   - Make classes java.util.List and org.jfree.chart.axis.NumberTickUnit extend a common superclass

   12

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

   15

       return false;

   15 | return false;
   13 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   13

       return false;

   Precondition Violations (15)
   Row | Violation
   --- | ---
   1 | Unmatched return true;
   2 | Type boolean of variable obj instanceof CombinedDomainXYPlot does not match with type boolean of variable obj instanceof NumberAxis
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Unmatched return false;
   6 | Unmatched return false;
   7 | Type java.util.List of variable this.subplots does not match with type org.jfree.chart.axis.NumberTickUnit of variable this.tickUnit
   8 | Conditional return false;
   9 | Conditional return true;
   10 | Conditional return false;
   11 | Conditional return false;
   12 | Conditional return false;
   13 | Conditional return false;
   14 | Conditional return false;
   15 | Conditional return false;