File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYDrawableAnnotation.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryLabelPosition.java | |||
Method name: boolean equals(Object)
|
Method name: boolean equals(Object)
|
|||
Number of AST nodes: 18 | Number of AST nodes: 18 | |||
1 | if (obj == this) { // simple case↵ | 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 XYDrawableAnnotation)) {↵ | 4 | if (!(obj instanceof CategoryLabelPosition)) {↵ | |
9 | return false;↵ | 5 | return false;↵ | |
10 | }↵ | 6 | }↵ | |
11 | XYDrawableAnnotation that = (XYDrawableAnnotation) obj;↵ | 7 | CategoryLabelPosition that = (CategoryLabelPosition) obj;↵ | |
12 | if (this.x != that.x) {↵ | 8 | if (!this.categoryAnchor.equals(that.categoryAnchor)) {↵ | |
13 | return false;↵ | 9 | return false;↵ | |
14 | }↵ | 10 | }↵ | |
15 | if (this.y != that.y) {↵ | 11 | if (!this.labelAnchor.equals(that.labelAnchor)) {↵ | |
16 | return false;↵ | 12 | return false;↵ | |
17 | }↵ | 13 | }↵ | |
18 | if (this.width != that.width) {↵ | 14 | if (!this.rotationAnchor.equals(that.rotationAnchor)) {↵ | |
19 | return false;↵ | 15 | return false;↵ | |
20 | }↵ | 16 | }↵ | |
21 | if (this.height != that.height) {↵ | 17 | if (this.angle != that.angle) {↵ | |
22 | return false;↵ | 18 | return false;↵ | |
23 | }↵ | 19 | }↵ | |
24 | if (!ObjectUtilities.equal(this.drawable, that.drawable)) {↵ | 20 | if (↵ | |
25 | return false;↵ | |||
26 | }↵ | |||
27 | // seem to be the same...↵ | 21 | this.widthType != that.widthType) {↵ | |
22 | return false;↵ | |||
23 | }↵ | |||
24 | if (this.widthRatio != that.widthRatio) {↵ | |||
25 | return false;↵ | |||
26 | }↵ | |||
28 | return true; | 27 |
| |
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 | 113 |
Number of mapped statements | 14 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 4.9 |
Clone type | Type 3 |
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 CategoryLabelPosition)) | |||||||||||||||||||||||||||
4 | return false; | 4 | return false; | ||||||||||||||||||||||||||||
| 5 | CategoryLabelPosition that = (CategoryLabelPosition)obj; | |||||||||||||||||||||||||||||
5 | if (!(obj instanceof XYDrawableAnnotation)) |
| 6 | if (!this.categoryAnchor.equals(that.categoryAnchor)) | |||||||||||||||||||||||||||
6 | return false; | 7 | return false; | ||||||||||||||||||||||||||||
7 | XYDrawableAnnotation that = (XYDrawableAnnotation)obj; | | |||||||||||||||||||||||||||||
| 8 | if (!this.labelAnchor.equals(that.labelAnchor)) | |||||||||||||||||||||||||||||
|
| 9 | return false; | ||||||||||||||||||||||||||||
8 | if (this.x != that.x) |
| 12 | if (this.angle != that.angle) | |||||||||||||||||||||||||||
9 | return false; | 13 | return false; | ||||||||||||||||||||||||||||
10 | if (this.y != that.y) |
| 14 | if (this.widthType != that.widthType) | |||||||||||||||||||||||||||
11 | return false; | 15 | return false; | ||||||||||||||||||||||||||||
12 | if (this.width != that.width) |
| 16 | if (this.widthRatio != that.widthRatio) | |||||||||||||||||||||||||||
13 | return false; | 17 | return false; | ||||||||||||||||||||||||||||
14 | if (this.height != that.height) | | |||||||||||||||||||||||||||||
15 | return false; |
| | ||||||||||||||||||||||||||||
16 | if (!ObjectUtilities.equal(this.drawable, that.drawable)) |
| 10 | if (!this.rotationAnchor.equals(that.rotationAnchor)) | |||||||||||||||||||||||||||
17 | return false; | 11 | return false; |
Row | Violation |
---|---|
1 | Super method call if(!super.equals(obj)) cannot be extracted from method |
2 | Expression this.categoryAnchor.equals(that.categoryAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched return false; |
4 | Type double of variable that.x does not match with type double of variable that.angle |
5 | Expression that.x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Type double of variable this.y does not match with type org.jfree.chart.axis.CategoryLabelWidthType of variable this.widthType |
8 | Type double of variable that.y does not match with type org.jfree.chart.axis.CategoryLabelWidthType of variable that.widthType |
9 | Expression that.y cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression that.widthType cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Type double of variable that.y does not match with type org.jfree.chart.axis.CategoryLabelWidthType of variable that.widthType |
12 | Type double of variable this.width does not match with type float of variable this.widthRatio |
13 | Type double of variable that.width does not match with type float of variable that.widthRatio |
14 | Expression that.width cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Expression that.widthRatio cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Type double of variable that.width does not match with type float of variable that.widthRatio |
17 | Unmatched return false; |
18 | Expression ObjectUtilities.equal(this.drawable,that.drawable) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
19 | Expression this.rotationAnchor.equals(that.rotationAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
20 | Not all possible execution flows end in a return statement |
21 | The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.XYDrawableAnnotation and org.jfree.chart.axis.CategoryLabelPosition do not have a common superclass |