43-14-109

if (obj == this) { return true; } if (!(obj instanceof BorderArrangement)) { return false; } BorderArrangement that = (BorderArrangement) obj; if (!ObjectUtilities.equal(this.topBlock, that.topBlock)) { return false; } if (!ObjectUtilities.equal(this.bottomBlock, that.bottomBlock)) { return false; } if (!ObjectUtilities.equal(this.leftBlock, that.leftBlock)) { return false; } if (!ObjectUtilities.equal(this.rightBlock, that.rightBlock)) { return false; } if (!ObjectUtilities.equal(this.centerBlock, that.centerBlock)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof StandardCategorySeriesLabelGenerator)) { return false; } StandardCategorySeriesLabelGenerator that = (StandardCategorySeriesLabelGenerator) obj; if (!this.formatPattern.equals(that.formatPattern)) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/block/BorderArrangement.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/labels/StandardCategorySeriesLabelGenerator.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 16 |  | Number of AST nodes: 8

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof BorderArrangement)) {↵

4

            if (!(obj instanceof StandardCategorySeriesLabelGenerator)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            BorderArrangement that = (BorderArrangement) obj;↵

7

            ↵

8

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

9

                return false;↵

10

            }↵

11

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

12

                return false;↵

13

            }↵

14

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

15

                return false;↵

16

            }↵

17

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

18

                return false;↵

19

            }↵

20

            if (!ObjectUtilities.equal(this.centerBlock, that.centerBlock↵

8

    StandardCategorySeriesLabelGenerator that ↵

9

                    = (StandardCategorySeriesLabelGenerator) obj;↵

21

    )) {↵

10

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

22

                return false;↵

11

                return false;↵

23

            }↵

12

            }↵

24

            return true;

13

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 4
   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) | 0.4
   Clone type | Type 2

   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 BorderArrangement))

   3 | if (!(obj instanceof BorderArrangement))
   3 | if (!(obj instanceof StandardCategorySeriesLabelGenerator))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.block.BorderArrangement | org.jfree.chart.labels.StandardCategorySeriesLabelGenerator | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof StandardCategorySeriesLabelGenerator))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof BorderArrangement does not match with type boolean of variable obj instanceof StandardCategorySeriesLabelGenerator
   2 | Conditional return true;
   3 | Conditional return true;
   4 | Conditional return false;
   5 | Conditional return false;