File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYDrawableAnnotation.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ColorBar.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...↵ | 4 | ↵ | |
5 | if (!super.equals(obj)) {↵ | 5 | if (!(obj instanceof ColorBar)) {↵ | |
6 | return false;↵ | 6 | return false; ↵ | |
7 | }↵ | 7 | }↵ | |
8 | if (!(obj instanceof XYDrawableAnnotation)) {↵ | 8 | ↵ | |
9 | return false;↵ | |||
10 | }↵ | |||
11 | XYDrawableAnnotation that = (XYDrawableAnnotation) obj;↵ | |||
12 | if (this.x != that.x↵ | 9 | ColorBar that = (ColorBar) obj;↵ | |
10 | if (!this.axis.equals(that.axis)) {↵ | |||
11 | return false;↵ | |||
12 | }↵ | |||
13 | ) {↵ | 13 | if (this.colorBarThickness != that.colorBarThickness) {↵ | |
14 | return false;↵ | 14 | return false;↵ | |
15 | }↵ | 15 | }↵ | |
16 | if (this.y != that.y) {↵ | 16 | if (this.colorBarThicknessPercent != that.colorBarThicknessPercent) {↵ | |
17 | return false;↵ | 17 | return false;↵ | |
18 | }↵ | 18 | }↵ | |
19 | if (this.width != that.width) {↵ | 19 | if (!this.colorPalette.equals(that.colorPalette)) {↵ | |
20 | return false;↵ | 20 | return false;↵ | |
21 | }↵ | 21 | }↵ | |
22 | if (this.height != that.height) {↵ | 22 | if (this.colorBarLength != that.colorBarLength) {↵ | |
23 | return false;↵ | 23 | return false;↵ | |
24 | }↵ | 24 | }↵ | |
25 | if (!ObjectUtilities.equal(this.drawable, that.drawable)) {↵ | 25 | if (this.outerGap != that.outerGap) {↵ | |
26 | return false;↵ | 26 | return false;↵ | |
27 | }↵ | 27 | }↵ | |
28 | // seem to be the same...↵ | |||
29 | return true; | 28 |
| |
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) | 40.5 |
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 ColorBar)) | |||||||||||||||||||||||||||
4 | return false; | 4 | return false; | ||||||||||||||||||||||||||||
| 5 | ColorBar that = (ColorBar)obj; | |||||||||||||||||||||||||||||
5 | if (!(obj instanceof XYDrawableAnnotation)) |
| 6 | if (!this.axis.equals(that.axis)) | |||||||||||||||||||||||||||
6 | return false; | 7 | return false; | ||||||||||||||||||||||||||||
7 | XYDrawableAnnotation that = (XYDrawableAnnotation)obj; | | |||||||||||||||||||||||||||||
8 | if (this.x != that.x) |
| 10 | if (this.colorBarThicknessPercent != that.colorBarThicknessPercent) | |||||||||||||||||||||||||||
9 | return false; | 11 | return false; | ||||||||||||||||||||||||||||
10 | if (this.y != that.y) |
| 8 | if (this.colorBarThickness != that.colorBarThickness) | |||||||||||||||||||||||||||
11 | return false; | 9 | return false; | ||||||||||||||||||||||||||||
12 | if (this.width != that.width) |
| 14 | if (this.colorBarLength != that.colorBarLength) | |||||||||||||||||||||||||||
13 | return false; | 15 | return false; | ||||||||||||||||||||||||||||
14 | if (this.height != that.height) |
| 16 | if (this.outerGap != that.outerGap) | |||||||||||||||||||||||||||
15 | return false; | 17 | return false; | ||||||||||||||||||||||||||||
16 | if (!ObjectUtilities.equal(this.drawable, that.drawable)) |
| 12 | if (!this.colorPalette.equals(that.colorPalette)) | |||||||||||||||||||||||||||
17 | return false; | 13 | 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 this.axis.equals(that.axis) 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.colorBarThicknessPercent |
4 | Expression that.x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression that.colorBarThicknessPercent cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Type double of variable this.y does not match with type int of variable this.colorBarThickness |
7 | Type double of variable that.y does not match with type int of variable that.colorBarThickness |
8 | Expression that.y cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression that.colorBarThickness cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Type double of variable that.y does not match with type int of variable that.colorBarThickness |
11 | Type double of variable this.width does not match with type int of variable this.colorBarLength |
12 | Type double of variable that.width does not match with type int of variable that.colorBarLength |
13 | Expression that.width cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression that.colorBarLength cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Type double of variable that.width does not match with type int of variable that.colorBarLength |
16 | Type double of variable this.height does not match with type int of variable this.outerGap |
17 | Type double of variable that.height does not match with type int of variable that.outerGap |
18 | Expression that.height cannot be parameterized, because it has dependencies to/from statements that will be extracted |
19 | Expression that.outerGap cannot be parameterized, because it has dependencies to/from statements that will be extracted |
20 | Type double of variable that.height does not match with type int of variable that.outerGap |
21 | Expression ObjectUtilities.equal(this.drawable,that.drawable) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
22 | Expression this.colorPalette.equals(that.colorPalette) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
23 | The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.XYDrawableAnnotation and org.jfree.chart.axis.ColorBar do not have a common superclass |