File path: /jfreechart-1.0.10/experimental/org/jfree/experimental/chart/annotations/XYTitleAnnotation.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYLineAnnotation.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)) {↵ | |||
5 | return false;↵ | |||
6 | } ↵ | |||
4 | if (!(obj instanceof XYTitleAnnotation)) {↵ | 7 | if (!(obj instanceof XYLineAnnotation)) { ↵ | |
5 | return false;↵ | 8 | return false; ↵ | |
6 | }↵ | 9 | } ↵ | |
7 | XYTitleAnnotation that = (XYTitleAnnotation) obj;↵ | 10 | XYLineAnnotation that = (XYLineAnnotation) obj; ↵ | |
8 | if (this.coordinateType != that.coordinateType) {↵ | 11 | if (this.x1 != that.x1) { ↵ | |
9 | return false;↵ | 12 | return false; ↵ | |
10 | }↵ | 13 | } ↵ | |
11 | if (this.x != that.x) {↵ | 14 | if (this.y1 != that.y1) { ↵ | |
12 | return false;↵ | 15 | return false; ↵ | |
13 | }↵ | 16 | } ↵ | |
14 | if (this.y != that.y) {↵ | 17 | if (this.x2 != that.x2) { ↵ | |
15 | return false;↵ | 18 | return false; ↵ | |
16 | }↵ | 19 | } ↵ | |
17 | if (this.maxWidth != that.maxWidth) {↵ | 20 | if (this.y2 != that.y2) { ↵ | |
18 | return false;↵ | 21 | return false; ↵ | |
19 | }↵ | 22 | } ↵ | |
20 | if (this.maxHeight != that.maxHeight) {↵ | 23 | if (!PaintUtilities.equal(this.paint, that.paint)) { ↵ | |
21 | return false;↵ | 24 | return false; ↵ | |
22 | }↵ | 25 | } ↵ | |
23 | if (!ObjectUtilities.equal(this.title, that.title)) {↵ | 26 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) { ↵ | |
24 | return false;↵ | 27 | return false; ↵ | |
25 | }↵ | 28 | } ↵ | |
26 | if (!this.anchor.equals(that.anchor)) {↵ | 29 | ↵ | |
27 | return false;↵ | |||
28 | }↵ | |||
30 | // seems to be the same...↵ | |||
29 | return super.equals(obj); | 31 | 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) | 7.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 133 |
Number of mapped statements | 17 |
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) | 9.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (obj == this) | 1 | if (obj == this) | |||||||||||||||||||||||||||||||
2 | return true; | 2 | return true; | |||||||||||||||||||||||||||||||
3 | if (!(obj instanceof XYTitleAnnotation)) |
| 5 | if (!(obj instanceof XYLineAnnotation)) | ||||||||||||||||||||||||||||||
4 | return false; | 6 | return false; | |||||||||||||||||||||||||||||||
5 | XYTitleAnnotation that = (XYTitleAnnotation)obj; |
| 7 | XYLineAnnotation that = (XYLineAnnotation)obj; | ||||||||||||||||||||||||||||||
6 | if (this.coordinateType != that.coordinateType) |
| 8 | if (this.x1 != that.x1) | ||||||||||||||||||||||||||||||
7 | return false; | 9 | return false; | |||||||||||||||||||||||||||||||
8 | if (this.x != that.x) |
| 10 | if (this.y1 != that.y1) | ||||||||||||||||||||||||||||||
9 | return false; | 11 | return false; | |||||||||||||||||||||||||||||||
10 | if (this.y != that.y) |
| 12 | if (this.x2 != that.x2) | ||||||||||||||||||||||||||||||
11 | return false; | 13 | return false; | |||||||||||||||||||||||||||||||
12 | if (this.maxWidth != that.maxWidth) |
| 14 | if (this.y2 != that.y2) | ||||||||||||||||||||||||||||||
13 | return false; | 15 | return false; | |||||||||||||||||||||||||||||||
14 | if (this.maxHeight != that.maxHeight) |
| | |||||||||||||||||||||||||||||||
15 | return false; |
| | |||||||||||||||||||||||||||||||
16 | if (!ObjectUtilities.equal(this.title, that.title)) |
| 16 | if (!PaintUtilities.equal(this.paint, that.paint)) | ||||||||||||||||||||||||||||||
17 | return false; | 17 | return false; | |||||||||||||||||||||||||||||||
18 | if (!this.anchor.equals(that.anchor)) |
| 3 | if (!super.equals(obj)) | ||||||||||||||||||||||||||||||
19 | return false; | 4 | return false; |
Row | Violation |
---|---|
1 | Type org.jfree.experimental.chart.util.XYCoordinateType of variable this.coordinateType does not match with type double of variable this.x1 |
2 | Expression that.coordinateType 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 | Type org.jfree.experimental.chart.util.XYCoordinateType of variable that.coordinateType does not match with type double of variable that.x1 |
5 | Expression that.x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression that.y1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression that.y cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression that.x2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression that.maxWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression that.y2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Unmatched statement if(this.maxHeight != that.maxHeight) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
12 | Unmatched return false; |
13 | Type org.jfree.chart.title.Title of variable this.title does not match with type java.awt.Paint of variable this.paint |
14 | Expression that.title cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Type org.jfree.chart.title.Title of variable that.title does not match with type java.awt.Paint of variable that.paint |
17 | Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities |
18 | Expression this.anchor.equals(that.anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
19 | Super method call if(!super.equals(obj)) cannot be extracted from method |
20 | Clone fragment #1 returns variable that with type org.jfree.experimental.chart.annotations.XYTitleAnnotation , while Clone fragment #2 returns variable that with type org.jfree.chart.annotations.XYLineAnnotation |
21 | Not all possible execution flows end in a return statement |