278-1-2

if (obj == this) { return true; } if (!(obj instanceof MeterNeedle)) { return false; } MeterNeedle that = (MeterNeedle) obj; if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) { return false; } if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke)) { return false; } if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) { return false; } if (!PaintUtilities.equal(this.highlightPaint, that.highlightPaint)) { return false; } if (this.size != that.size) { return false; } if (this.rotateX != that.rotateX) { return false; } if (this.rotateY != that.rotateY) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof ArcDialFrame)) { return false; } ArcDialFrame that = (ArcDialFrame) obj; if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint)) { return false; } if (this.startAngle != that.startAngle) { return false; } if (this.extent != that.extent) { return false; } if (this.innerRadius != that.innerRadius) { return false; } if (this.outerRadius != that.outerRadius) { 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/needle/MeterNeedle.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/ArcDialFrame.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 20 |  | Number of AST nodes: 20

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof MeterNeedle)) {↵

4

            if (!(obj instanceof ArcDialFrame)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            MeterNeedle that = (MeterNeedle) obj;↵

7

            ArcDialFrame that = (ArcDialFrame) obj;↵

8

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

8

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

9

                return false;↵

9

                return false;↵

10

            }↵

10

            }↵

11

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

11

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

12

                return false;↵

12

                return false;↵

13

            }↵

13

            }↵

14

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

14

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

15

                return false;↵

15

                return false;↵

16

            }↵

16

            }↵

17

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

17

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

18

                return false;↵

18

                return false;↵

19

            }↵

19

            }↵

20

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

20

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

21

                return false;↵

21

                return false;↵

22

            }↵

22

            }↵

23

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

23

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

24

                return false;↵

24

                return false;↵

25

            }↵

25

            }↵

26

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

26

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

27

                return false;↵

27

                return false;↵

28

            }↵

28

            }↵

29

            return true;

29

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

1. {Non-refactorable}

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

   3 | if (!(obj instanceof MeterNeedle))
   3 | if (!(obj instanceof ArcDialFrame))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.needle.MeterNeedle | org.jfree.chart.plot.dial.ArcDialFrame | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof ArcDialFrame))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       ArcDialFrame that = (ArcDialFrame)obj;

   5

       MeterNeedle that = (MeterNeedle)obj;

   6

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

   6 | if (! PaintUtilities.equal(this.outlinePaint, that.outlinePaint))
   6 | if (! PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   outlinePaint | backgroundPaint | VARIABLE_NAME_MISMATCH
   org.jfree.chart.needle.MeterNeedle | org.jfree.chart.plot.dial.ArcDialFrame | VARIABLE_TYPE_MISMATCH
   outlinePaint | backgroundPaint | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.needle.MeterNeedle of variable that does not match with type org.jfree.chart.plot.dial.ArcDialFrame of variable that
   - Make classes org.jfree.chart.needle.MeterNeedle and org.jfree.chart.plot.dial.ArcDialFrame extend a common superclass

   6

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

   7

       return false;

   7 | return false;
   7 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   7

       return false;

   8

       if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke))

   8 | if (! ObjectUtilities.equal(this.outlineStroke, that.outlineStroke))
   8 | if (! PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   outlineStroke | foregroundPaint | VARIABLE_NAME_MISMATCH
   java.awt.Stroke | java.awt.Paint | VARIABLE_TYPE_MISMATCH
   org.jfree.util.ObjectUtilities | org.jfree.util.PaintUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.awt.Stroke of variable this.outlineStroke does not match with type java.awt.Paint of variable this.foregroundPaint
   - Make classes java.awt.Stroke and java.awt.Paint extend a common superclass

   Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   - Make classes org.jfree.util.ObjectUtilities and org.jfree.util.PaintUtilities extend a common superclass

   8

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

   9

       return false;

   9 | return false;
   9 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   9

       return false;

   10

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

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

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

   13

       return false;

   13 | return false;

   Preondition Violations
   Unmatched return false;

   14

       if (this.size != that.size)

   15

       return false;

   15 | return false;

   Preondition Violations
   Unmatched return false;

   16

       if (this.rotateX != that.rotateX)

   16 | if (this.rotateX != that.rotateX)
   12 | if (this.extent != that.extent)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   rotateX | extent | VARIABLE_NAME_MISMATCH
   org.jfree.chart.needle.MeterNeedle | org.jfree.chart.plot.dial.ArcDialFrame | VARIABLE_TYPE_MISMATCH
   rotateX | extent | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.needle.MeterNeedle of variable that does not match with type org.jfree.chart.plot.dial.ArcDialFrame of variable that
   - Make classes org.jfree.chart.needle.MeterNeedle and org.jfree.chart.plot.dial.ArcDialFrame extend a common superclass

   12

       if (this.extent != that.extent)

   17

       return false;

   17 | return false;
   13 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   13

       return false;

   18

       if (this.rotateY != that.rotateY)

   18 | if (this.rotateY != that.rotateY)
   10 | if (this.startAngle != that.startAngle)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   rotateY | startAngle | VARIABLE_NAME_MISMATCH
   org.jfree.chart.needle.MeterNeedle | org.jfree.chart.plot.dial.ArcDialFrame | VARIABLE_TYPE_MISMATCH
   rotateY | startAngle | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.needle.MeterNeedle of variable that does not match with type org.jfree.chart.plot.dial.ArcDialFrame of variable that
   - Make classes org.jfree.chart.needle.MeterNeedle and org.jfree.chart.plot.dial.ArcDialFrame extend a common superclass

   10

       if (this.startAngle != that.startAngle)

   19

       return false;

   19 | return false;
   11 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   11

       return false;

   Precondition Violations (21)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof MeterNeedle does not match with type boolean of variable obj instanceof ArcDialFrame
   2 | Type org.jfree.chart.needle.MeterNeedle of variable that does not match with type org.jfree.chart.plot.dial.ArcDialFrame of variable that
   3 | Type java.awt.Stroke of variable this.outlineStroke does not match with type java.awt.Paint of variable this.foregroundPaint
   4 | Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   5 | Unmatched return false;
   6 | Unmatched return false;
   7 | Unmatched return false;
   8 | Type org.jfree.chart.needle.MeterNeedle of variable that does not match with type org.jfree.chart.plot.dial.ArcDialFrame of variable that
   9 | Type org.jfree.chart.needle.MeterNeedle of variable that does not match with type org.jfree.chart.plot.dial.ArcDialFrame of variable that
   10 | Conditional return true;
   11 | Conditional return true;
   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;
   19 | Conditional return false;
   20 | Conditional return false;
   21 | Conditional return false;