File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYLineAnnotation.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 (!super.equals(obj)) {↵ | 4 | if (!(obj instanceof ArcDialFrame)) {↵ | |
5 | return false;↵ | 5 | return false;↵ | |
6 | }↵ | 6 | }↵ | |
7 | if (!(obj instanceof XYLineAnnotation)) {↵ | 7 | ↵ | |
8 | return false;↵ | |||
9 | }↵ | |||
10 | XYLineAnnotation that = (XYLineAnnotation) obj;↵ | |||
11 | if (this.x1 != that.x1↵ | 8 | ArcDialFrame that = (ArcDialFrame) obj;↵ | |
9 | if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {↵ | |||
10 | return false;↵ | |||
11 | }↵ | |||
12 | ) {↵ | 12 | if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint)) {↵ | |
13 | return false;↵ | 13 | return false;↵ | |
14 | }↵ | 14 | }↵ | |
15 | if (this.y1 != that.y1) {↵ | 15 | if (this.startAngle != that.startAngle) {↵ | |
16 | return false;↵ | 16 | return false;↵ | |
17 | }↵ | 17 | }↵ | |
18 | if (this.x2 != that.x2) {↵ | 18 | if (this.extent != that.extent) {↵ | |
19 | return false;↵ | 19 | return false;↵ | |
20 | }↵ | 20 | }↵ | |
21 | if (this.y2 != that.y2) {↵ | 21 | if (this.innerRadius != that.innerRadius) {↵ | |
22 | return false;↵ | 22 | return false;↵ | |
23 | }↵ | 23 | }↵ | |
24 | if (!PaintUtilities.equal(this.paint, that.paint)) {↵ | 24 | if (this.outerRadius != that.outerRadius) {↵ | |
25 | return false;↵ | 25 | return false;↵ | |
26 | }↵ | 26 | }↵ | |
27 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) {↵ | 27 | if (!this.stroke.equals(that.stroke)) {↵ | |
28 | return false;↵ | 28 | return false;↵ | |
29 | }↵ | 29 | }↵ | |
30 | // seems to be the same...↵ | 30 | ↵ | |
31 | return true; | 31 | return super.equals(obj); | |
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) | 7.9 |
Clones location | Clones are in different classes |
Number of node comparisons | 148 |
Number of mapped statements | 19 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 8.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (obj == this) | 1 | if (obj == this) | |||||||||||||||||||||||||||||||
2 | return true; | 2 | return true; | |||||||||||||||||||||||||||||||
3 | if (!super.equals(obj)) |
| 3 | if (!(obj instanceof ArcDialFrame)) | ||||||||||||||||||||||||||||||
4 | return false; | 4 | return false; | |||||||||||||||||||||||||||||||
| 5 | ArcDialFrame that = (ArcDialFrame)obj; | ||||||||||||||||||||||||||||||||
5 | if (!(obj instanceof XYLineAnnotation)) |
| 18 | if (!this.stroke.equals(that.stroke)) | ||||||||||||||||||||||||||||||
6 | return false; | 19 | return false; | |||||||||||||||||||||||||||||||
7 | XYLineAnnotation that = (XYLineAnnotation)obj; | | ||||||||||||||||||||||||||||||||
8 | if (this.x1 != that.x1) |
| 10 | if (this.startAngle != that.startAngle) | ||||||||||||||||||||||||||||||
9 | return false; | 11 | return false; | |||||||||||||||||||||||||||||||
10 | if (this.y1 != that.y1) |
| 12 | if (this.extent != that.extent) | ||||||||||||||||||||||||||||||
11 | return false; | 13 | return false; | |||||||||||||||||||||||||||||||
12 | if (this.x2 != that.x2) |
| 14 | if (this.innerRadius != that.innerRadius) | ||||||||||||||||||||||||||||||
13 | return false; | 15 | return false; | |||||||||||||||||||||||||||||||
14 | if (this.y2 != that.y2) |
| 16 | if (this.outerRadius != that.outerRadius) | ||||||||||||||||||||||||||||||
15 | return false; | 17 | return false; | |||||||||||||||||||||||||||||||
16 | if (!PaintUtilities.equal(this.paint, that.paint)) |
| 8 | if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint)) | ||||||||||||||||||||||||||||||
17 | return false; | 9 | return false; | |||||||||||||||||||||||||||||||
18 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) |
| 6 | if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) | ||||||||||||||||||||||||||||||
19 | return false; | 7 | return false; | |||||||||||||||||||||||||||||||
20 | return true; |
| 20 | return super.equals(obj); |
Row | Violation |
---|---|
1 | Super method call if(!super.equals(obj)) cannot be extracted from method |
2 | Expression this.stroke.equals(that.stroke) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression that.x1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression that.startAngle cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression that.y1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression that.extent cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression that.x2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression that.innerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression that.y2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression that.outerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression that.foregroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Type java.awt.Stroke of variable this.stroke does not match with type java.awt.Paint of variable this.backgroundPaint |
14 | Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Type java.awt.Stroke of variable that.stroke does not match with type java.awt.Paint of variable that.backgroundPaint |
17 | Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities |
18 | Super method call return super.equals(obj); cannot be extracted from method |
19 | The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.XYLineAnnotation and org.jfree.chart.plot.dial.ArcDialFrame do not have a common superclass |