File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/CategoryLineAnnotation.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/entity/CategoryItemEntity.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 CategoryLineAnnotation)) {↵ | 4 | if (!(obj instanceof CategoryItemEntity)) {↵ | |
5 | return false;↵ | 5 | return false;↵ | |
6 | }↵ | 6 | }↵ | |
7 | CategoryLineAnnotation that = (CategoryLineAnnotation) obj;↵ | 7 | CategoryItemEntity that = (CategoryItemEntity) obj;↵ | |
8 | if (!this.category1.equals(that.getCategory1())) {↵ | 8 | if (!this.rowKey.equals(that.rowKey)) {↵ | |
9 | return false;↵ | 9 | return false;↵ | |
10 | }↵ | 10 | }↵ | |
11 | if (this.value1 != that.getValue1()) {↵ | 11 | if (!this.columnKey.equals(that.columnKey)) {↵ | |
12 | return false;↵ | 12 | return false;↵ | |
13 | }↵ | 13 | }↵ | |
14 | if (!this.category2.equals(that.getCategory2())) {↵ | 14 | if (!ObjectUtilities.equal(this.dataset, that.dataset)) {↵ | |
15 | return false;↵ | 15 | return false;↵ | |
16 | }↵ | 16 | }↵ | |
17 | if (this.value2 != that.getValue2()↵ | 17 | ↵ | |
18 | // check the deprecated fields↵ | |||
18 | ) {↵ | 19 | if (this.categoryIndex != that.categoryIndex) {↵ | |
19 | return false;↵ | 20 | return false; ↵ | |
20 | }↵ | 21 | }↵ | |
21 | if (!PaintUtilities.equal(this.paint, that.paint)) {↵ | 22 | if (this.series != that.series) {↵ | |
22 | return false;↵ | 23 | return false; ↵ | |
23 | }↵ | 24 | }↵ | |
24 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) {↵ | 25 | if (!ObjectUtilities.equal(this.category, that.category)) {↵ | |
25 | return false;↵ | 26 | return false; ↵ | |
26 | }↵ | 27 | }↵ | |
27 | return true; | 28 | 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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 113 |
Number of mapped statements | 13 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 6.7 |
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 CategoryLineAnnotation)) |
| 3 | if (!(obj instanceof CategoryItemEntity)) | ||||||||||||||||||||||||||||||
4 | return false; | 4 | return false; | |||||||||||||||||||||||||||||||
5 | CategoryLineAnnotation that = (CategoryLineAnnotation)obj; |
| 5 | CategoryItemEntity that = (CategoryItemEntity)obj; | ||||||||||||||||||||||||||||||
6 | if (!this.category1.equals(that.getCategory1())) |
| 6 | if (!this.rowKey.equals(that.rowKey)) | ||||||||||||||||||||||||||||||
7 | return false; | 7 | return false; | |||||||||||||||||||||||||||||||
8 | if (this.value1 != that.getValue1()) |
| | |||||||||||||||||||||||||||||||
9 | return false; |
| | |||||||||||||||||||||||||||||||
10 | if (!this.category2.equals(that.getCategory2())) |
| 8 | if (!this.columnKey.equals(that.columnKey)) | ||||||||||||||||||||||||||||||
11 | return false; | 9 | return false; | |||||||||||||||||||||||||||||||
|
| 12 | if (this.categoryIndex != that.categoryIndex) | |||||||||||||||||||||||||||||||
|
| 13 | return false; | |||||||||||||||||||||||||||||||
12 | if (this.value2 != that.getValue2()) |
| | |||||||||||||||||||||||||||||||
13 | return false; |
| | |||||||||||||||||||||||||||||||
|
| 14 | if (this.series != that.series) | |||||||||||||||||||||||||||||||
|
| 15 | return false; | |||||||||||||||||||||||||||||||
14 | if (!PaintUtilities.equal(this.paint, that.paint)) |
| 16 | if (!ObjectUtilities.equal(this.category, that.category)) | ||||||||||||||||||||||||||||||
15 | return false; | 17 | return false; | |||||||||||||||||||||||||||||||
16 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) |
| 10 | if (!ObjectUtilities.equal(this.dataset, that.dataset)) | ||||||||||||||||||||||||||||||
17 | return false; | 11 | return false; |
Row | Violation |
---|---|
1 | Expression that.getCategory1() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression that.rowKey cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement if(this.value1 != that.getValue1()) 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 | Expression that.getCategory2() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression that.columnKey cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement if(this.categoryIndex != that.categoryIndex) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched return false; |
9 | Unmatched statement if(this.value2 != that.getValue2()) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
10 | Unmatched return false; |
11 | Unmatched statement if(this.series != that.series) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
12 | Unmatched return false; |
13 | Type java.awt.Paint of variable this.paint does not match with type java.lang.Object of variable this.category |
14 | Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Expression that.category cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Type java.awt.Paint of variable that.paint does not match with type java.lang.Object of variable that.category |
17 | Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities |
18 | Type java.awt.Stroke of variable this.stroke does not match with type org.jfree.data.category.CategoryDataset of variable this.dataset |
19 | Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted |
20 | Expression that.dataset cannot be parameterized, because it has dependencies to/from statements that will be extracted |
21 | Type java.awt.Stroke of variable that.stroke does not match with type org.jfree.data.category.CategoryDataset of variable that.dataset |
22 | Clone fragment #1 returns variable that with type org.jfree.chart.annotations.CategoryLineAnnotation , while Clone fragment #2 returns variable that with type org.jfree.chart.entity.CategoryItemEntity |
23 | Not all possible execution flows end in a return statement |
24 | The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.CategoryLineAnnotation and org.jfree.chart.entity.CategoryItemEntity do not have a common superclass |