File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYTextAnnotation.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/BarRenderer.java | |||
Method name: boolean equals(Object)
|
Method name: boolean equals(Object)
|
|||
Number of AST nodes: 24 | Number of AST nodes: 24 | |||
1 | if (obj == this) {↵ | 1 | if (obj == this) {↵ | |
2 | return true; ↵ | 2 | return true;↵ | |
3 | }↵ | 3 | }↵ | |
4 | if (!(obj instanceof XYTextAnnotation)) {↵ | 4 | if (!(obj instanceof BarRenderer)) {↵ | |
5 | return false; ↵ | 5 | return false;↵ | |
6 | }↵ | 6 | }↵ | |
7 | if (!super.equals(obj)) {↵ | 7 | if (!super.equals(obj)) {↵ | |
8 | return false;↵ | 8 | return false;↵ | |
9 | }↵ | 9 | }↵ | |
10 | XYTextAnnotation that = (XYTextAnnotation) obj;↵ | 10 | BarRenderer that = (BarRenderer) obj;↵ | |
11 | if (!this.text.equals(that.text)) {↵ | 11 | if (this.base != that.base) {↵ | |
12 | return false; ↵ | 12 | return false;↵ | |
13 | }↵ | 13 | }↵ | |
14 | if (this.x != that.x) {↵ | 14 | if (this.itemMargin != that.itemMargin) {↵ | |
15 | return false;↵ | 15 | return false;↵ | |
16 | }↵ | 16 | }↵ | |
17 | if (this.y != that.y) {↵ | 17 | if (this.drawBarOutline != that.drawBarOutline) {↵ | |
18 | return false;↵ | 18 | return false;↵ | |
19 | }↵ | 19 | }↵ | |
20 | if (!this.font.equals(that.font)) {↵ | 20 | if (this.maximumBarWidth != that.maximumBarWidth) {↵ | |
21 | return false; ↵ | 21 | return false;↵ | |
22 | }↵ | 22 | }↵ | |
23 | if (!PaintUtilities.equal(this.paint, that.paint)) {↵ | 23 | if (this.minimumBarLength != that.minimumBarLength) {↵ | |
24 | return false; ↵ | 24 | return false;↵ | |
25 | }↵ | 25 | }↵ | |
26 | if (!this.rotationAnchor.equals(that.rotationAncho↵ | 26 | if (!ObjectUtilities.equal(this.gradientPaintTransformer,↵ | |
27 | r)) {↵ | 27 | that.gradientPaintTransformer)) {↵ | |
28 | return false; ↵ | 28 | return false;↵ | |
29 | }↵ | 29 | }↵ | |
30 | if (this.rotationAngle != that.rotationAngle↵ | 30 | if (!ObjectUtilities.equal(this.positiveItemLabelPositionFallback,↵ | |
31 | ) {↵ | 31 | that.positiveItemLabelPositionFallback)) {↵ | |
32 | return false; ↵ | 32 | return false;↵ | |
33 | }↵ | 33 | }↵ | |
34 | if (!this.textAnchor.equals(that.textAnchor↵ | 34 | if (!ObjectUtilities.equal(this.negativeItemLabelPositionFallback,↵ | |
35 | )) {↵ | 35 | that.negativeItemLabelPositionFallback)) {↵ | |
36 | return false; ↵ | 36 | return false;↵ | |
37 | }↵ | 37 | }↵ | |
38 | return true; | 38 |
| |
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) | 9.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 206 |
Number of mapped statements | 19 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 11.4 |
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 XYTextAnnotation)) |
| 3 | if (!(obj instanceof BarRenderer)) | ||||||||||||||||||||||||||||||
4 | return false; | 4 | return false; | |||||||||||||||||||||||||||||||
5 | if (!super.equals(obj)) |
| 5 | if (!super.equals(obj)) | ||||||||||||||||||||||||||||||
6 | return false; | 6 | return false; | |||||||||||||||||||||||||||||||
7 | XYTextAnnotation that = (XYTextAnnotation)obj; |
| 7 | BarRenderer that = (BarRenderer)obj; | ||||||||||||||||||||||||||||||
|
| 8 | if (this.base != that.base) | |||||||||||||||||||||||||||||||
|
| 9 | return false; | |||||||||||||||||||||||||||||||
|
| 12 | if (this.drawBarOutline != that.drawBarOutline) | |||||||||||||||||||||||||||||||
|
| 13 | return false; | |||||||||||||||||||||||||||||||
8 | if (!this.text.equals(that.text)) |
| 18 | if (!ObjectUtilities.equal(this.gradientPaintTransformer, that.gradientPaintTransformer)) | ||||||||||||||||||||||||||||||
9 | return false; | 19 | return false; | |||||||||||||||||||||||||||||||
10 | if (this.x != that.x) |
| 10 | if (this.itemMargin != that.itemMargin) | ||||||||||||||||||||||||||||||
11 | return false; | 11 | return false; | |||||||||||||||||||||||||||||||
12 | if (this.y != that.y) |
| 14 | if (this.maximumBarWidth != that.maximumBarWidth) | ||||||||||||||||||||||||||||||
13 | return false; | 15 | return false; | |||||||||||||||||||||||||||||||
14 | if (!this.font.equals(that.font)) |
| 20 | if (!ObjectUtilities.equal(this.positiveItemLabelPositionFallback, that.positiveItemLabelPositionFallback)) | ||||||||||||||||||||||||||||||
15 | return false; | 21 | return false; | |||||||||||||||||||||||||||||||
16 | if (!PaintUtilities.equal(this.paint, that.paint)) |
| 22 | if (!ObjectUtilities.equal(this.negativeItemLabelPositionFallback, that.negativeItemLabelPositionFallback)) | ||||||||||||||||||||||||||||||
17 | return false; | 23 | return false; | |||||||||||||||||||||||||||||||
18 | if (!this.rotationAnchor.equals(that.rotationAnchor)) |
| | |||||||||||||||||||||||||||||||
19 | return false; |
| | |||||||||||||||||||||||||||||||
20 | if (this.rotationAngle != that.rotationAngle) |
| 16 | if (this.minimumBarLength != that.minimumBarLength) | ||||||||||||||||||||||||||||||
21 | return false; | 17 | return false; |
Row | Violation |
---|---|
1 | Super method call if(!super.equals(obj)) cannot be extracted from method |
2 | Super method call if(!super.equals(obj)) cannot be extracted from method |
3 | Unmatched statement if(this.base != that.base) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched return false; |
5 | Unmatched statement if(this.drawBarOutline != that.drawBarOutline) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched return false; |
7 | Expression this.text.equals(that.text) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression ObjectUtilities.equal(this.gradientPaintTransformer,that.gradientPaintTransformer) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression that.x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression that.itemMargin cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression that.y cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression that.maximumBarWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression this.font.equals(that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression ObjectUtilities.equal(this.positiveItemLabelPositionFallback,that.positiveItemLabelPositionFallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Type java.awt.Paint of variable this.paint does not match with type org.jfree.chart.labels.ItemLabelPosition of variable this.negativeItemLabelPositionFallback |
16 | Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Expression that.negativeItemLabelPositionFallback cannot be parameterized, because it has dependencies to/from statements that will be extracted |
18 | Type java.awt.Paint of variable that.paint does not match with type org.jfree.chart.labels.ItemLabelPosition of variable that.negativeItemLabelPositionFallback |
19 | Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities |
20 | Unmatched statement if(!this.rotationAnchor.equals(that.rotationAnchor)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
21 | Unmatched return false; |
22 | Expression that.rotationAngle cannot be parameterized, because it has dependencies to/from statements that will be extracted |
23 | Expression that.minimumBarLength cannot be parameterized, because it has dependencies to/from statements that will be extracted |
24 | Clone fragment #1 returns variable that with type org.jfree.chart.annotations.XYTextAnnotation , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.category.BarRenderer |
25 | Not all possible execution flows end in a return statement |
26 | The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.XYTextAnnotation and org.jfree.chart.renderer.category.BarRenderer do not have a common superclass |