File path: /jfreechart-1.0.10/src/org/jfree/chart/entity/CategoryItemEntity.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/DialTextAnnotation.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 DialTextAnnotation)) {↵ | |
5 | return false;↵ | 5 | return false;↵ | |
6 | }↵ | 6 | }↵ | |
7 | CategoryItemEntity that = (CategoryItemEntity) obj;↵ | 7 | DialTextAnnotation that = (DialTextAnnotation) obj;↵ | |
8 | if (!this.rowKey.equals(that.rowKey)) {↵ | 8 | if (!this.label.equals(that.label)) {↵ | |
9 | return false;↵ | 9 | return false;↵ | |
10 | }↵ | 10 | }↵ | |
11 | if (!this.columnKey.equals(that.columnKey)) {↵ | 11 | if (!this.font.equals(that.font)) {↵ | |
12 | return false;↵ | 12 | return false;↵ | |
13 | }↵ | 13 | }↵ | |
14 | if (!ObjectUtilities.equal(this.dataset, that.dataset)) {↵ | 14 | if (!PaintUtilities.equal(this.paint, that.paint)) {↵ | |
15 | return false;↵ | 15 | return false;↵ | |
16 | }↵ | 16 | }↵ | |
17 | ↵ | 17 | ↵ | |
18 | // check the deprecated fields↵ | |||
19 | if (this.categoryIndex != that.categoryIndex) {↵ | 18 | if (this.radius != that.radius) {↵ | |
20 | return false; ↵ | 19 | return false;↵ | |
21 | }↵ | 20 | }↵ | |
22 | if (this.series != that.series) {↵ | 21 | if (this.angle != that.angle) {↵ | |
23 | return false; ↵ | 22 | return false;↵ | |
24 | }↵ | 23 | }↵ | |
25 | if (!ObjectUtilities.equal(this.category, that.category)) {↵ | 24 | if (!this.anchor.equals(that.anchor)) {↵ | |
26 | return false; ↵ | 25 | return false;↵ | |
27 | }↵ | 26 | }↵ | |
28 | return super.equals(obj); | 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) | 5.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 125 |
Number of mapped statements | 18 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 6.8 |
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 DialTextAnnotation)) | ||||||||||||||||||||||||||||||
4 | return false; | 4 | return false; | |||||||||||||||||||||||||||||||
5 | CategoryItemEntity that = (CategoryItemEntity)obj; |
| 5 | DialTextAnnotation that = (DialTextAnnotation)obj; | ||||||||||||||||||||||||||||||
6 | if (!this.rowKey.equals(that.rowKey)) |
| 6 | if (!this.label.equals(that.label)) | ||||||||||||||||||||||||||||||
7 | return false; | 7 | return false; | |||||||||||||||||||||||||||||||
8 | if (!this.columnKey.equals(that.columnKey)) |
| 8 | if (!this.font.equals(that.font)) | ||||||||||||||||||||||||||||||
9 | return false; | 9 | return false; | |||||||||||||||||||||||||||||||
10 | if (!ObjectUtilities.equal(this.dataset, that.dataset)) |
| 10 | if (!PaintUtilities.equal(this.paint, that.paint)) | ||||||||||||||||||||||||||||||
11 | return false; | 11 | return false; | |||||||||||||||||||||||||||||||
12 | if (this.categoryIndex != that.categoryIndex) |
| 12 | if (this.radius != that.radius) | ||||||||||||||||||||||||||||||
13 | return false; | 13 | return false; | |||||||||||||||||||||||||||||||
14 | if (this.series != that.series) |
| 14 | if (this.angle != that.angle) | ||||||||||||||||||||||||||||||
15 | return false; | 15 | return false; | |||||||||||||||||||||||||||||||
16 | if (!ObjectUtilities.equal(this.category, that.category)) |
| 16 | if (!this.anchor.equals(that.anchor)) | ||||||||||||||||||||||||||||||
17 | return false; | 17 | return false; | |||||||||||||||||||||||||||||||
18 | return super.equals(obj); |
| 18 | return super.equals(obj); |
Row | Violation |
---|---|
1 | Expression that.rowKey cannot be unified with expression that.label , because common superclass type java.lang.Comparable cannot be passed as an argument to public boolean equals(java.lang.Object) |
2 | Expression that.rowKey cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression that.label cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Type java.lang.Comparable of variable that.rowKey does not match with type java.lang.String of variable that.label |
5 | Type java.lang.Comparable of variable this.rowKey does not match with type java.lang.String of variable this.label |
6 | Expression that.columnKey cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression that.font cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Type java.lang.Comparable of variable that.columnKey does not match with type java.awt.Font of variable that.font |
9 | Type java.lang.Comparable of variable this.columnKey does not match with type java.awt.Font of variable this.font |
10 | Type org.jfree.data.category.CategoryDataset of variable this.dataset does not match with type java.awt.Paint of variable this.paint |
11 | Expression that.dataset cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Type org.jfree.data.category.CategoryDataset of variable that.dataset does not match with type java.awt.Paint of variable that.paint |
14 | Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities |
15 | Type int of variable this.categoryIndex does not match with type double of variable this.radius |
16 | Expression that.categoryIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted |
18 | Type int of variable that.categoryIndex does not match with type double of variable that.radius |
19 | Type int of variable this.series does not match with type double of variable this.angle |
20 | Expression that.series cannot be parameterized, because it has dependencies to/from statements that will be extracted |
21 | Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted |
22 | Type int of variable that.series does not match with type double of variable that.angle |
23 | Expression ObjectUtilities.equal(this.category,that.category) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
24 | Expression this.anchor.equals(that.anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
25 | Super method call return super.equals(obj); cannot be extracted from method |
26 | Super method call return super.equals(obj); cannot be extracted from method |
27 | The refactoring of the clones is infeasible, because classes org.jfree.chart.entity.CategoryItemEntity and org.jfree.chart.plot.dial.DialTextAnnotation do not have a common superclass |