File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/DialCap.java | File path: /jfreechart-1.0.10/src/org/jfree/data/gantt/Task.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 (object == this) {↵ | |
2 | return true;↵ | 2 | return true;↵ | |
3 | }↵ | 3 | }↵ | |
4 | if (!(obj instanceof DialCap)) {↵ | 4 | if (!(object instanceof Task)) {↵ | |
5 | return false;↵ | 5 | return false;↵ | |
6 | }↵ | 6 | }↵ | |
7 | DialCap that = (DialCap) obj;↵ | 7 | Task that = (Task) object;↵ | |
8 | if (this.radius != that.radius) {↵ | 8 | if (!ObjectUtilities.equal(this.description, that.description)) {↵ | |
9 | return false;↵ | 9 | return false;↵ | |
10 | }↵ | 10 | }↵ | |
11 | if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) {↵ | 11 | if (!ObjectUtilities.equal(this.duration, that.duration)) {↵ | |
12 | return false;↵ | 12 | return false;↵ | |
13 | }↵ | 13 | }↵ | |
14 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint↵ | 14 | if (!ObjectUtilities.equal(this.percentComplete, ↵ | |
15 | )) {↵ | 15 | that.percentComplete)) {↵ | |
16 | return false;↵ | 16 | return false;↵ | |
17 | }↵ | 17 | }↵ | |
18 | if (!this.outlineStroke.equals(that.outlineStroke)) {↵ | 18 | if (!ObjectUtilities.equal(this.subtasks, that.subtasks)) {↵ | |
19 | return false;↵ | 19 | return false;↵ | |
20 | }↵ | 20 | }↵ | |
21 | return super.equals(obj); | 21 | return true; | |
See real code fragment | See real code fragment |
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 70 |
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.8 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (obj == this) |
| 1 | if (object == this) | ||||||||||||||||||||||||||||||
2 | return true; | 2 | return true; | |||||||||||||||||||||||||||||||
3 | if (!(obj instanceof DialCap)) |
| 3 | if (!(object instanceof Task)) | ||||||||||||||||||||||||||||||
4 | return false; | 4 | return false; | |||||||||||||||||||||||||||||||
5 | DialCap that = (DialCap)obj; |
| 5 | Task that = (Task)object; | ||||||||||||||||||||||||||||||
6 | if (this.radius != that.radius) |
| | |||||||||||||||||||||||||||||||
7 | return false; |
| | |||||||||||||||||||||||||||||||
8 | if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) |
| 8 | if (!ObjectUtilities.equal(this.duration, that.duration)) | ||||||||||||||||||||||||||||||
9 | return false; | 9 | return false; | |||||||||||||||||||||||||||||||
10 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) |
| 10 | if (!ObjectUtilities.equal(this.percentComplete, that.percentComplete)) | ||||||||||||||||||||||||||||||
11 | return false; | 11 | return false; | |||||||||||||||||||||||||||||||
12 | if (!this.outlineStroke.equals(that.outlineStroke)) |
| 6 | if (!ObjectUtilities.equal(this.description, that.description)) | ||||||||||||||||||||||||||||||
13 | return false; | 7 | return false; |
Row | Violation |
---|---|
1 | Unmatched statement if(this.radius != that.radius) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched return false; |
3 | Type java.awt.Paint of variable this.fillPaint does not match with type org.jfree.data.time.TimePeriod of variable this.duration |
4 | Expression that.fillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression that.duration cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Type java.awt.Paint of variable that.fillPaint does not match with type org.jfree.data.time.TimePeriod of variable that.duration |
7 | Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities |
8 | Type java.awt.Paint of variable this.outlinePaint does not match with type java.lang.Double of variable this.percentComplete |
9 | Expression that.outlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression that.percentComplete cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Type java.awt.Paint of variable that.outlinePaint does not match with type java.lang.Double of variable that.percentComplete |
12 | Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities |
13 | Expression this.outlineStroke.equals(that.outlineStroke) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression ObjectUtilities.equal(this.description,that.description) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Clone fragment #1 returns variable that with type org.jfree.chart.plot.dial.DialCap , while Clone fragment #2 returns variable that with type org.jfree.data.gantt.Task |
16 | Not all possible execution flows end in a return statement |
17 | The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.dial.DialCap and org.jfree.data.gantt.Task do not have a common superclass |