File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYImageAnnotation.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/GanttRenderer.java | |||
Method name: boolean equals(Object)
|
Method name: boolean equals(Object)
|
|||
Number of AST nodes: 16 | Number of AST nodes: 14 | |||
1 | if (obj == this) {↵ | 1 | if (obj == this) {↵ | |
2 | return true;↵ | 2 | return true;↵ | |
3 | }↵ | 3 | }↵ | |
4 | // now try to reject equality...↵ | |||
5 | if (!super.equals(obj)) {↵ | |||
6 | return false;↵ | |||
7 | }↵ | |||
8 | if (!(obj instanceof XYImageAnnotation)) {↵ | 4 | if (!(obj instanceof GanttRenderer)) {↵ | |
9 | return false;↵ | 5 | return false;↵ | |
10 | }↵ | 6 | }↵ | |
11 | XYImageAnnotation that = (XYImageAnnotation) obj;↵ | 7 | ↵ | |
12 | if (this.x != that.x) {↵ | |||
13 | return false;↵ | |||
14 | }↵ | |||
15 | if (this.y != that.y↵ | 8 | GanttRenderer that = (GanttRenderer) obj;↵ | |
9 | if (!PaintUtilities.equal(this.completePaint, that.completePaint)) {↵ | |||
10 | return false;↵ | |||
11 | }↵ | |||
16 | ) {↵ | 12 | if (!PaintUtilities.equal(this.incompletePaint, that.incompletePaint)) {↵ | |
17 | return false;↵ | 13 | return false;↵ | |
18 | }↵ | 14 | }↵ | |
19 | if (!ObjectUtilities.equal(this.image, that.image)) {↵ | 15 | if (this.startPercent != that.startPercent) {↵ | |
20 | return false;↵ | 16 | return false;↵ | |
21 | }↵ | 17 | }↵ | |
22 | if (!this.anchor.equals(that.anchor)) {↵ | 18 | if (this.endPercent != that.endPercent) {↵ | |
23 | return false;↵ | 19 | return false;↵ | |
24 | }↵ | 20 | }↵ | |
25 | // seems to be the same...↵ | 21 | ↵ | |
26 | return true; | 22 | 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) | 3.8 |
Clones location | Clones are in different classes |
Number of node comparisons | 76 |
Number of mapped statements | 13 |
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) | 4.9 |
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 GanttRenderer)) | ||||||||||||||||||||||||||||||
4 | return false; | 4 | return false; | |||||||||||||||||||||||||||||||
| 5 | GanttRenderer that = (GanttRenderer)obj; | ||||||||||||||||||||||||||||||||
5 | if (!(obj instanceof XYImageAnnotation)) |
| 6 | if (!PaintUtilities.equal(this.completePaint, that.completePaint)) | ||||||||||||||||||||||||||||||
6 | return false; | 7 | return false; | |||||||||||||||||||||||||||||||
7 | XYImageAnnotation that = (XYImageAnnotation)obj; | | ||||||||||||||||||||||||||||||||
8 | if (this.x != that.x) |
| 10 | if (this.startPercent != that.startPercent) | ||||||||||||||||||||||||||||||
9 | return false; | 11 | return false; | |||||||||||||||||||||||||||||||
10 | if (this.y != that.y) |
| 12 | if (this.endPercent != that.endPercent) | ||||||||||||||||||||||||||||||
11 | return false; | 13 | return false; | |||||||||||||||||||||||||||||||
12 | if (!ObjectUtilities.equal(this.image, that.image)) |
| 8 | if (!PaintUtilities.equal(this.incompletePaint, that.incompletePaint)) | ||||||||||||||||||||||||||||||
13 | return false; | 9 | return false; | |||||||||||||||||||||||||||||||
16 | return true; |
| 14 | return super.equals(obj); |
Row | Violation |
---|---|
1 | Super method call if(!super.equals(obj)) cannot be extracted from method |
2 | Expression PaintUtilities.equal(this.completePaint,that.completePaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression that.x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression that.startPercent cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression that.y cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression that.endPercent cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Type java.awt.Image of variable this.image does not match with type java.awt.Paint of variable this.incompletePaint |
8 | Expression that.image cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression that.incompletePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Type java.awt.Image of variable that.image does not match with type java.awt.Paint of variable that.incompletePaint |
11 | Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities |
12 | Super method call return super.equals(obj); cannot be extracted from method |
13 | Not all possible execution flows end in a return statement |
14 | The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.XYImageAnnotation and org.jfree.chart.renderer.category.GanttRenderer do not have a common superclass |