File path: /jfreechart-1.0.10/src/org/jfree/chart/entity/CategoryItemEntity.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYDifferenceRenderer.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) {↵ | 1 | if (obj == this) {↵ | |
2 | return true; ↵ | 2 | return true; ↵ | |
3 | }↵ | 3 | }↵ | |
4 | if (!(obj instanceof CategoryItemEntity)) {↵ | 4 | if (!(obj instanceof XYDifferenceRenderer)) {↵ | |
5 | return false;↵ | 5 | return false;↵ | |
6 | }↵ | 6 | ↵ | |
7 | CategoryItemEntity that = (CategoryItemEntity) obj;↵ | 7 | }↵ | |
8 | if (!this.rowKey.equals(that.rowKey)) {↵ | 8 | if (!super.equals(obj)) {↵ | |
9 | return false;↵ | 9 | return false; ↵ | |
10 | }↵ | 10 | }↵ | |
11 | if (!this.columnKey↵ | 11 | XYDifferenceRenderer that = (XYDifferenceRenderer) obj;↵ | |
12 | .equals(that.columnKey)) {↵ | 12 | if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) {↵ | |
13 | return false;↵ | 13 | return false; ↵ | |
14 | }↵ | 14 | }↵ | |
15 | if (!ObjectUtilities.equal(this.dataset, that.dataset)) {↵ | 15 | if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) {↵ | |
16 | return false;↵ | 16 | return false; ↵ | |
17 | }↵ | 17 | }↵ | |
18 | ↵ | 18 | ↵ | |
19 | // check the deprecated fields↵ | |||
20 | if (this.categoryIndex != that.categoryIndex) {↵ | 19 | if (this.shapesVisible != that.shapesVisible) {↵ | |
21 | return false; ↵ | 20 | return false; ↵ | |
22 | }↵ | 21 | }↵ | |
23 | if (this.series != that.series) {↵ | 22 | if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) {↵ | |
24 | return false; ↵ | 23 | return false; ↵ | |
25 | }↵ | 24 | }↵ | |
26 | if (!ObjectUtilities.equal(this.category, that.category)) {↵ | 25 | if (this.roundXCoordinates != that.roundXCoordinates) {↵ | |
27 | return false; ↵ | 26 | return false;↵ | |
28 | }↵ | 27 | }↵ | |
29 | return super.equals(obj); | 28 | return true; | |
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 125 |
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) | 8.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (obj == this) | 1 | if (obj == this) | |||||||||||||||||||||||||||||||
2 | return true; | 2 | return true; | |||||||||||||||||||||||||||||||
3 | if (!(obj instanceof CategoryItemEntity)) |
| 3 | if (!(obj instanceof XYDifferenceRenderer)) | ||||||||||||||||||||||||||||||
4 | return false; | 4 | return false; | |||||||||||||||||||||||||||||||
5 | CategoryItemEntity that = (CategoryItemEntity)obj; | | ||||||||||||||||||||||||||||||||
6 | if (!this.rowKey.equals(that.rowKey)) |
| 5 | if (!super.equals(obj)) | ||||||||||||||||||||||||||||||
7 | return false; | 6 | return false; | |||||||||||||||||||||||||||||||
| 7 | XYDifferenceRenderer that = (XYDifferenceRenderer)obj; | ||||||||||||||||||||||||||||||||
8 | if (!this.columnKey.equals(that.columnKey)) |
| 8 | if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) | ||||||||||||||||||||||||||||||
9 | return false; | 9 | return false; | |||||||||||||||||||||||||||||||
10 | if (!ObjectUtilities.equal(this.dataset, that.dataset)) |
| 10 | if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) | ||||||||||||||||||||||||||||||
11 | return false; | 11 | return false; | |||||||||||||||||||||||||||||||
12 | if (this.categoryIndex != that.categoryIndex) |
| 12 | if (this.shapesVisible != that.shapesVisible) | ||||||||||||||||||||||||||||||
13 | return false; | 13 | return false; | |||||||||||||||||||||||||||||||
14 | if (this.series != that.series) |
| 16 | if (this.roundXCoordinates != that.roundXCoordinates) | ||||||||||||||||||||||||||||||
15 | return false; | 17 | return false; | |||||||||||||||||||||||||||||||
16 | if (!ObjectUtilities.equal(this.category, that.category)) |
| 14 | if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) | ||||||||||||||||||||||||||||||
17 | return false; | 15 | return false; | |||||||||||||||||||||||||||||||
18 | return super.equals(obj); |
| 18 | return true; |
Row | Violation |
---|---|
1 | Expression this.rowKey.equals(that.rowKey) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Super method call if(!super.equals(obj)) cannot be extracted from method |
3 | Expression this.columnKey.equals(that.columnKey) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression PaintUtilities.equal(this.positivePaint,that.positivePaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Type org.jfree.data.category.CategoryDataset of variable this.dataset does not match with type java.awt.Paint of variable this.negativePaint |
6 | Expression that.dataset cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression that.negativePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Type org.jfree.data.category.CategoryDataset of variable that.dataset does not match with type java.awt.Paint of variable that.negativePaint |
9 | Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities |
10 | Type int of variable this.categoryIndex does not match with type boolean of variable this.shapesVisible |
11 | Expression that.categoryIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression that.shapesVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Type int of variable that.categoryIndex does not match with type boolean of variable that.shapesVisible |
14 | Type int of variable this.series does not match with type boolean of variable this.roundXCoordinates |
15 | Expression that.series cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Expression that.roundXCoordinates cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Type int of variable that.series does not match with type boolean of variable that.roundXCoordinates |
18 | Type java.lang.Object of variable this.category does not match with type java.awt.Shape of variable this.legendLine |
19 | Expression that.category cannot be parameterized, because it has dependencies to/from statements that will be extracted |
20 | Expression that.legendLine cannot be parameterized, because it has dependencies to/from statements that will be extracted |
21 | Type java.lang.Object of variable that.category does not match with type java.awt.Shape of variable that.legendLine |
22 | Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.ShapeUtilities |
23 | Super method call return super.equals(obj); cannot be extracted from method |
24 | The refactoring of the clones is infeasible, because classes org.jfree.chart.entity.CategoryItemEntity and org.jfree.chart.renderer.xy.XYDifferenceRenderer do not have a common superclass |