43-1-5

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 MarkerAxisBand)) { return false; } MarkerAxisBand that = (MarkerAxisBand) obj; if (this.topOuterGap != that.topOuterGap) { return false; } if (this.topInnerGap != that.topInnerGap) { return false; } if (this.bottomInnerGap != that.bottomInnerGap) { return false; } if (this.bottomOuterGap != that.bottomOuterGap) { return false; } if (!ObjectUtilities.equal(this.font, that.font)) { return false; } if (!ObjectUtilities.equal(this.markers, that.markers)) { 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/MarkerAxisBand.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 22 |  | Number of AST nodes: 18

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 MarkerAxisBand)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            PieLabelRecord that = (PieLabelRecord) obj;↵

7

            MarkerAxisBand that = (MarkerAxisBand) obj;↵

8

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

8

            if (this.↵

9

                return false;↵

10

            }↵

11

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

9

    topOuterGap != that.topOuterGap) {↵

12

                return false;↵

10

                return false;↵

13

            }↵

11

            }↵

14

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

12

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

15

                return false;↵

13

                return false;↵

16

            }↵

14

            }↵

17

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

15

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

18

                return false;↵

16

                return false;↵

19

            }↵

17

            }↵

20

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

18

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

21

                return false;↵

19

                return false;↵

22

            }↵

20

            }↵

23

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

21

            if (↵

24

                return false;↵

25

            }↵

26

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

22

    !ObjectUtilities.equal(this.font, that.font)) {↵

27

                return false;↵

23

                return false;↵

28

            }↵

24

            }↵

29

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

25

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

30

                return false;↵

26

                return false;↵

31

            }↵

27

            }↵

32

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

1. {Non-refactorable}

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

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

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

   Preondition Violations

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

   3

       if (!(obj instanceof MarkerAxisBand))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       MarkerAxisBand that = (MarkerAxisBand)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.topInnerGap != that.topInnerGap)

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

   Preondition Violations

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

   8

       if (this.topInnerGap != that.topInnerGap)

   9

       return false;

   9 | return false;
   9 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   9

       return false;

   10

       if (this.gap != that.gap)

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

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

   Preondition Violations

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

   10

       if (this.bottomInnerGap != that.bottomInnerGap)

   11

       return false;

   11 | return false;
   11 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   11

       return false;

   12

       if (this.allocatedY != that.allocatedY)

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

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

   Preondition Violations

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

   12

       if (this.bottomOuterGap != that.bottomOuterGap)

   13

       return false;

   13 | return false;
   13 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   13

       return false;

   14

       if (this.baseY != that.baseY)

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

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

   Preondition Violations

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

   6

       if (this.topOuterGap != that.topOuterGap)

   15

       return false;

   15 | return false;
   7 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   7

       return false;

   Precondition Violations (18)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof PieLabelRecord does not match with type boolean of variable obj instanceof MarkerAxisBand
   2 | Unmatched return false;
   3 | Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.axis.MarkerAxisBand of variable that
   4 | Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.axis.MarkerAxisBand of variable that
   5 | Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.axis.MarkerAxisBand of variable that
   6 | Type org.jfree.chart.plot.PieLabelRecord of variable that does not match with type org.jfree.chart.axis.MarkerAxisBand of variable that
   7 | Conditional return true;
   8 | Conditional return true;
   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;
   16 | Conditional return false;
   17 | Conditional return false;
   18 | Conditional return false;