43-20-44

if (obj == this) { return true; } if (!(obj instanceof FlowArrangement)) { return false; } FlowArrangement that = (FlowArrangement) obj; if (this.horizontalAlignment != that.horizontalAlignment) { return false; } if (this.verticalAlignment != that.verticalAlignment) { return false; } if (this.horizontalGap != that.horizontalGap) { return false; } if (this.verticalGap != that.verticalGap) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof StandardDialFrame)) { return false; } StandardDialFrame that = (StandardDialFrame) obj; if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint)) { return false; } if (this.radius != that.radius) { return false; } if (!this.stroke.equals(that.stroke)) { return false; } return super.equals(obj);

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

4

            if (!(obj instanceof StandardDialFrame)) {↵

5

                return false;   ↵

5

                return false;↵

6

            }↵

6

            }↵

7

            FlowArrangement that = (FlowArrangement) obj;↵

7

            ↵

8

            if (this.horizontalAlignment != that.horizontalAlignme↵

8

    StandardDialFrame that = (StandardDialFrame) obj;↵

9

    nt) {↵

9

            if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {↵

10

                return false;↵

10

                return false;↵

11

            }↵

11

            }↵

12

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

12

            if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint)) {↵

13

                return false;↵

13

                return false;↵

14

            }↵

14

            }↵

15

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

15

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

16

                return false;   ↵

16

                return false;↵

17

            }↵

17

            }↵

18

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

18

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

19

                return false;   ↵

19

                return false;↵

20

            }↵

20

            }↵

21

            return true;

21

            return super.equals(obj);

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 6
   Number of unmapped statements in the first code fragment | 5
   Number of unmapped statements in the second code fragment | 5
   Time elapsed for statement mapping (ms) | 0.7
   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 FlowArrangement))

   3 | if (!(obj instanceof FlowArrangement))
   3 | if (!(obj instanceof StandardDialFrame))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.block.FlowArrangement | org.jfree.chart.plot.dial.StandardDialFrame | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof FlowArrangement does not match with type boolean of variable obj instanceof StandardDialFrame
   - Make classes org.jfree.chart.block.FlowArrangement and org.jfree.chart.plot.dial.StandardDialFrame extend a common superclass

   3

       if (!(obj instanceof StandardDialFrame))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       StandardDialFrame that = (StandardDialFrame)obj;

   5

       FlowArrangement that = (FlowArrangement)obj;

   6

       if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))

   7 | return false;

   Preondition Violations
   Unmatched return false;

   7

       return false;

   6

       if (this.horizontalAlignment != that.horizontalAlignment)

   7

       return false;

   7 | return false;

   Preondition Violations
   Unmatched return false;

   8

       if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint))

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   8

       if (this.verticalAlignment != that.verticalAlignment)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

       if (this.horizontalGap != that.horizontalGap)

   10 | if (this.horizontalGap != that.horizontalGap)
   10 | if (this.radius != that.radius)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   horizontalGap | radius | VARIABLE_NAME_MISMATCH
   org.jfree.chart.block.FlowArrangement | org.jfree.chart.plot.dial.StandardDialFrame | VARIABLE_TYPE_MISMATCH
   horizontalGap | radius | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.block.FlowArrangement of variable that does not match with type org.jfree.chart.plot.dial.StandardDialFrame of variable that
   - Make classes org.jfree.chart.block.FlowArrangement and org.jfree.chart.plot.dial.StandardDialFrame extend a common superclass

   10

       if (this.radius != that.radius)

   11

       return false;

   11 | return false;
   11 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   11

       return false;

   Precondition Violations (12)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof FlowArrangement does not match with type boolean of variable obj instanceof StandardDialFrame
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Unmatched return false;
   6 | Type org.jfree.chart.block.FlowArrangement of variable that does not match with type org.jfree.chart.plot.dial.StandardDialFrame 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;