File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYDrawableAnnotation.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/MarkerAxisBand.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 MarkerAxisBand)) {↵ | |
9 | return false;↵ | 5 | return false;↵ | |
10 | }↵ | 6 | }↵ | |
11 | XYDrawableAnnotation that = (XYDrawableAnnotation) obj;↵ | 7 | ↵ | |
12 | if (this.x != that.x↵ | 8 | MarkerAxisBand that = (MarkerAxisBand) obj;↵ | |
13 | ) {↵ | 9 | if (this.topOuterGap != that.topOuterGap) {↵ | |
14 | return false;↵ | 10 | return false;↵ | |
15 | }↵ | 11 | }↵ | |
16 | if (this.y != that.y) {↵ | 12 | if (this.topInnerGap != that.topInnerGap) {↵ | |
17 | return false;↵ | 13 | return false;↵ | |
18 | }↵ | 14 | }↵ | |
19 | if (this.width != that.width) {↵ | 15 | if (this.bottomInnerGap != that.bottomInnerGap) {↵ | |
20 | return false;↵ | 16 | return false;↵ | |
21 | }↵ | 17 | }↵ | |
22 | if (this.height != that.height) {↵ | 18 | if (this.bottomOuterGap != that.bottomOuterGap) {↵ | |
23 | return false;↵ | 19 | return false;↵ | |
24 | }↵ | 20 | }↵ | |
25 | if (!ObjectUtilities.equal(this.drawable, that.drawable)) {↵ | 21 | if (!ObjectUtilities.equal(this.font, that.font)) {↵ | |
26 | return false;↵ | 22 | return false;↵ | |
27 | }↵ | 23 | }↵ | |
28 | // seem to be the same...↵ | 24 | if (!ObjectUtilities.equal(this.markers, that.markers)) {↵ | |
25 | return false;↵ | |||
26 | }↵ | |||
29 | 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) | 4.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 119 |
Number of mapped statements | 17 |
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 MarkerAxisBand)) | |||||||||||||||||||||||||||
4 | return false; | 4 | return false; | ||||||||||||||||||||||||||||
| 5 | MarkerAxisBand that = (MarkerAxisBand)obj; | |||||||||||||||||||||||||||||
5 | if (!(obj instanceof XYDrawableAnnotation)) |
| 14 | if (!ObjectUtilities.equal(this.font, that.font)) | |||||||||||||||||||||||||||
6 | return false; | 15 | return false; | ||||||||||||||||||||||||||||
7 | XYDrawableAnnotation that = (XYDrawableAnnotation)obj; | | |||||||||||||||||||||||||||||
8 | if (this.x != that.x) |
| 8 | if (this.topInnerGap != that.topInnerGap) | |||||||||||||||||||||||||||
9 | return false; | 9 | return false; | ||||||||||||||||||||||||||||
10 | if (this.y != that.y) |
| 10 | if (this.bottomInnerGap != that.bottomInnerGap) | |||||||||||||||||||||||||||
11 | return false; | 11 | return false; | ||||||||||||||||||||||||||||
12 | if (this.width != that.width) |
| 12 | if (this.bottomOuterGap != that.bottomOuterGap) | |||||||||||||||||||||||||||
13 | return false; | 13 | return false; | ||||||||||||||||||||||||||||
14 | if (this.height != that.height) |
| 6 | if (this.topOuterGap != that.topOuterGap) | |||||||||||||||||||||||||||
15 | return false; | 7 | return false; | ||||||||||||||||||||||||||||
16 | if (!ObjectUtilities.equal(this.drawable, that.drawable)) |
| 16 | if (!ObjectUtilities.equal(this.markers, that.markers)) | |||||||||||||||||||||||||||
17 | return false; | 17 | return false; | ||||||||||||||||||||||||||||
18 | return true; | 18 | return true; |
Row | Violation |
---|---|
1 | Super method call if(!super.equals(obj)) cannot be extracted from method |
2 | Expression ObjectUtilities.equal(this.font,that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Type double of variable that.x does not match with type double of variable that.topInnerGap |
4 | Expression that.x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression that.topInnerGap cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Type double of variable that.y does not match with type double of variable that.bottomInnerGap |
7 | Expression that.y cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression that.bottomInnerGap cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Type double of variable that.width does not match with type double of variable that.bottomOuterGap |
10 | Expression that.width cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression that.bottomOuterGap cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Type double of variable that.height does not match with type double of variable that.topOuterGap |
13 | Expression that.height cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression that.topOuterGap cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Type org.jfree.ui.Drawable of variable this.drawable does not match with type java.util.List of variable this.markers |
16 | Type org.jfree.ui.Drawable of variable that.drawable does not match with type java.util.List of variable that.markers |
17 | Expression that.drawable cannot be parameterized, because it has dependencies to/from statements that will be extracted |
18 | Expression that.markers cannot be parameterized, because it has dependencies to/from statements that will be extracted |
19 | Type org.jfree.ui.Drawable of variable that.drawable does not match with type java.util.List of variable that.markers |
20 | The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.XYDrawableAnnotation and org.jfree.chart.axis.MarkerAxisBand do not have a common superclass |