43-137-140

if (obj == this) { return true; } if (!(obj instanceof PointerNeedle)) { return false; } if (!super.equals(obj)) { return false; } return true;
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;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/needle/PointerNeedle.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainCategoryPlot.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 7 |  | 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 PointerNeedle)) {↵

4

            if (!(obj instanceof CombinedDomainCategoryPlot)) {↵

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;↵

11

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

12

                return false;↵

13

            }↵

14

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

15

                return false;↵

16

            }↵

17

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

18

                return false;↵

19

            }↵

10

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

1. {Non-refactorable}

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

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

   1

       if (obj == this)

   1

       if (obj == this)

   2

       return true;

   2

       return true;

   3

       if (!(obj instanceof PointerNeedle))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.needle.PointerNeedle | org.jfree.chart.plot.CombinedDomainCategoryPlot | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof CombinedDomainCategoryPlot))

   4

       return false;

   4

       return false;

   5

       if (!super.equals(obj))

   5

       if (!super.equals(obj))

   6

       return false;

   6

       return false;

   7

       CombinedDomainCategoryPlot plot = (CombinedDomainCategoryPlot)obj;

   8

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

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   10

       if (this.totalWeight != plot.totalWeight)

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   12

       if (this.gap != plot.gap)

   13 | return false;

   Preondition Violations
   Unmatched return false;

   13

       return false;

   7

       return true;

   14

       return true;

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof PointerNeedle does not match with type boolean of variable obj instanceof CombinedDomainCategoryPlot
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;