File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYDrawableAnnotation.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/StandardDialRange.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 StandardDialRange)) {↵ | |
9 | return false;↵ | 5 | return false;↵ | |
10 | }↵ | 6 | }↵ | |
11 | XYDrawableAnnotation that = (XYDrawableAnnotation) obj;↵ | 7 | StandardDialRange that = (StandardDialRange) obj;↵ | |
12 | if (this.x != that.x) {↵ | 8 | if (this.scaleIndex != that.scaleIndex) {↵ | |
13 | return false;↵ | 9 | return false;↵ | |
14 | }↵ | 10 | }↵ | |
15 | if (this.y != that.y) {↵ | 11 | if (this.lowerBound != that.lowerBound) {↵ | |
16 | return false;↵ | 12 | return false;↵ | |
17 | }↵ | 13 | }↵ | |
18 | if (this.width != that.width) {↵ | 14 | if (this.upperBound != that.upperBound) {↵ | |
19 | return false;↵ | 15 | return false;↵ | |
20 | }↵ | 16 | }↵ | |
21 | if (this.height != that.height) {↵ | 17 | if (!PaintUtilities.equal(this.paint, that.paint)) {↵ | |
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...↵ | |||
28 | return true↵ | 21 | this.innerRadius != that.innerRadius) {↵ | |
22 | return false;↵ | |||
23 | }↵ | |||
24 | if (this.outerRadius != that.outerRadius) {↵ | |||
25 | return false;↵ | |||
26 | }↵ | |||
29 | ; | 27 | 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) | 5.6 |
Clones location | Clones are in different classes |
Number of node comparisons | 107 |
Number of mapped statements | 14 |
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) | 5.1 |
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 StandardDialRange)) | ||||||||||||||||||||||||||
4 | return false; | 4 | return false; | |||||||||||||||||||||||||||
| 5 | StandardDialRange that = (StandardDialRange)obj; | ||||||||||||||||||||||||||||
5 | if (!(obj instanceof XYDrawableAnnotation)) |
| 12 | if (!PaintUtilities.equal(this.paint, that.paint)) | ||||||||||||||||||||||||||
6 | return false; | 13 | return false; | |||||||||||||||||||||||||||
7 | XYDrawableAnnotation that = (XYDrawableAnnotation)obj; | | ||||||||||||||||||||||||||||
8 | if (this.x != that.x) |
| 8 | if (this.lowerBound != that.lowerBound) | ||||||||||||||||||||||||||
9 | return false; | 9 | return false; | |||||||||||||||||||||||||||
10 | if (this.y != that.y) |
| 10 | if (this.upperBound != that.upperBound) | ||||||||||||||||||||||||||
11 | return false; | 11 | return false; | |||||||||||||||||||||||||||
12 | if (this.width != that.width) |
| 14 | if (this.innerRadius != that.innerRadius) | ||||||||||||||||||||||||||
13 | return false; | 15 | return false; | |||||||||||||||||||||||||||
14 | if (this.height != that.height) |
| 6 | if (this.scaleIndex != that.scaleIndex) | ||||||||||||||||||||||||||
15 | return false; | 7 | return false; |
Row | Violation |
---|---|
1 | Super method call if(!super.equals(obj)) cannot be extracted from method |
2 | Expression PaintUtilities.equal(this.paint,that.paint) 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.lowerBound 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.upperBound cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression that.width cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression that.innerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Type double of variable this.height does not match with type int of variable this.scaleIndex |
10 | Expression that.height cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression that.scaleIndex 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 int of variable that.scaleIndex |
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.XYDrawableAnnotation and org.jfree.chart.plot.dial.StandardDialRange do not have a common superclass |