43-1-16

if (obj == this) { return true; } if (!(obj instanceof PieLabelRecord)) { return false; } PieLabelRecord that = (PieLabelRecord) obj; if (!this.key.equals(that.key)) { return false; } if (this.angle != that.angle) { return false; } if (this.gap != that.gap) { return false; } if (this.allocatedY != that.allocatedY) { return false; } if (this.baseY != that.baseY) { return false; } if (this.labelHeight != that.labelHeight) { return false; } if (this.linkPercent != that.linkPercent) { return false; } if (!this.label.equals(that.label)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof AxisSpace)) { return false; } AxisSpace that = (AxisSpace) obj; if (this.top != that.top) { return false; } if (this.bottom != that.bottom) { return false; } if (this.left != that.left) { return false; } if (this.right != that.right) { return false; } return true;

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

4

            if (!(obj instanceof AxisSpace)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            PieLabelRecord that = (PieLabelRecord) obj;↵

7

            AxisSpace that = (AxisSpace) obj;↵

8

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

8

            if (this.↵

9

                return false;↵

10

            }↵

11

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

9

    top != that.top) {↵

12

                return false;↵

10

                return false;↵

13

            }↵

11

            }↵

14

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

12

       ↵

15

                return false;↵

16

            }↵

17

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

13

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

18

                return false;↵

14

                return false;↵

19

            }↵

15

            }↵

20

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

16

            if (this.↵

21

                return false;↵

22

            }↵

23

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

17

    left != that.left) {↵

24

                return false;↵

18

                return false;↵

25

            }↵

19

            }↵

26

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

20

            if (this.↵

27

                return false;↵

28

            }↵

29

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

21

    right != that.right) {↵

30

                return false;↵

22

                return false;↵

31

            }↵

23

            }↵

32

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 13
   Number of unmapped statements in the first code fragment | 9
   Number of unmapped statements in the second code fragment | 1
   Time elapsed for statement mapping (ms) | 2.9
   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 PieLabelRecord))

   3 | if (!(obj instanceof PieLabelRecord))
   3 | if (!(obj instanceof AxisSpace))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.PieLabelRecord | org.jfree.chart.axis.AxisSpace | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof AxisSpace))

   4

       return false;

   4

       return false;

   5

       AxisSpace that = (AxisSpace)obj;

   5

       PieLabelRecord that = (PieLabelRecord)obj;

   6

       if (!this.key.equals(that.key))

   7

       return false;

   7 | return false;

   Preondition Violations
   Unmatched return false;

   8

       if (this.angle != that.angle)

   8 | if (this.angle != that.angle)
   8 | if (this.bottom != that.bottom)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   angle | bottom | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.PieLabelRecord | org.jfree.chart.axis.AxisSpace | VARIABLE_TYPE_MISMATCH
   angle | bottom | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.axis.AxisSpace of variable that
   - Make classes org.jfree.chart.plot.PieLabelRecord and org.jfree.chart.axis.AxisSpace extend a common superclass

   8

       if (this.bottom != that.bottom)

   9

       return false;

   9

       return false;

   10

       if (this.gap != that.gap)

   10 | if (this.gap != that.gap)
   10 | if (this.left != that.left)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   gap | left | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.PieLabelRecord | org.jfree.chart.axis.AxisSpace | VARIABLE_TYPE_MISMATCH
   gap | left | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.axis.AxisSpace of variable that
   - Make classes org.jfree.chart.plot.PieLabelRecord and org.jfree.chart.axis.AxisSpace extend a common superclass

   10

       if (this.left != that.left)

   11

       return false;

   11

       return false;

   12

       if (this.allocatedY != that.allocatedY)

   12 | if (this.allocatedY != that.allocatedY)
   12 | if (this.right != that.right)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   allocatedY | right | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.PieLabelRecord | org.jfree.chart.axis.AxisSpace | VARIABLE_TYPE_MISMATCH
   allocatedY | right | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.axis.AxisSpace of variable that
   - Make classes org.jfree.chart.plot.PieLabelRecord and org.jfree.chart.axis.AxisSpace extend a common superclass

   12

       if (this.right != that.right)

   13

       return false;

   13

       return false;

   14

       if (this.baseY != that.baseY)

   14 | if (this.baseY != that.baseY)
   6 | if (this.top != that.top)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   baseY | top | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.PieLabelRecord | org.jfree.chart.axis.AxisSpace | VARIABLE_TYPE_MISMATCH
   baseY | top | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.axis.AxisSpace of variable that
   - Make classes org.jfree.chart.plot.PieLabelRecord and org.jfree.chart.axis.AxisSpace extend a common superclass

   6

       if (this.top != that.top)

   15

       return false;

   7

       return false;

   16

       if (this.labelHeight != that.labelHeight)

   17

       return false;

   17 | return false;

   Preondition Violations
   Unmatched return false;

   18

       if (this.linkPercent != that.linkPercent)

   19

       return false;

   19 | return false;

   Preondition Violations
   Unmatched return false;

   20

       if (!this.label.equals(that.label))

   21

       return false;

   21 | return false;

   Preondition Violations
   Unmatched return false;

   22

       return true;

   14

       return true;

   Precondition Violations (9)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof PieLabelRecord does not match with type boolean of variable obj instanceof AxisSpace
   2 | Unmatched return false;
   3 | Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.axis.AxisSpace of variable that
   4 | Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.axis.AxisSpace of variable that
   5 | Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.axis.AxisSpace of variable that
   6 | Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.axis.AxisSpace of variable that
   7 | Unmatched return false;
   8 | Unmatched return false;
   9 | Unmatched return false;