File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYImageAnnotation.java | File path: /jfreechart-1.0.10/src/org/jfree/data/category/DefaultIntervalCategoryDataset.java | |||
Method name: boolean equals(Object)
|
Method name: boolean equals(Object)
|
|||
Number of AST nodes: 16 | Number of AST nodes: 14 | |||
1 | if (obj == this) {↵ | 1 | if (obj == this) {↵ | |
2 | return true;↵ | 2 | return true;↵ | |
3 | }↵ | 3 | }↵ | |
4 | // now try to reject equality...↵ | 4 | ↵ | |
5 | if (!super.equals(obj)) {↵ | |||
6 | return false;↵ | |||
7 | }↵ | |||
8 | if (!(obj instanceof XYImageAnnotation)) {↵ | |||
9 | return false;↵ | 5 | if (!(obj instanceof DefaultIntervalCategoryDataset)) {↵ | |
6 | return false;↵ | |||
7 | }↵ | |||
8 | DefaultIntervalCategoryDataset that ↵ | |||
10 | }↵ | 9 | ↵ | |
11 | XYImageAnnotation that = (XYImageAnnotation) obj;↵ | 10 | ↵ | |
12 | if (this.x != that.x↵ | 11 | = (DefaultIntervalCategoryDataset) obj;↵ | |
13 | ) {↵ | 12 | if (!Arrays.equals(this.seriesKeys, that.seriesKeys)) {↵ | |
14 | return false;↵ | 13 | return false;↵ | |
15 | }↵ | 14 | }↵ | |
16 | if (this.y != that.y) {↵ | 15 | if (!Arrays.equals(this.categoryKeys, that.categoryKeys)) {↵ | |
17 | return false;↵ | 16 | return false;↵ | |
18 | }↵ | 17 | }↵ | |
19 | if (!ObjectUtilities.equal(this.image, that.image)) {↵ | 18 | if (!equal(this.startData, that.startData)) {↵ | |
20 | return false;↵ | 19 | return false;↵ | |
21 | }↵ | 20 | }↵ | |
22 | if (!this.anchor.equals(that.anchor)) {↵ | 21 | if (!equal(this.endData, that.endData)) {↵ | |
23 | return false;↵ | 22 | return false;↵ | |
24 | }↵ | 23 | }↵ | |
25 | // seems to be the same...↵ | 24 | // seem to be the same...↵ | |
26 | return true; | 25 |
| |
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) | 3.8 |
Clones location | Clones are in different classes |
Number of node comparisons | 64 |
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 7 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.8 |
Clone type | Type 3 |
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 DefaultIntervalCategoryDataset)) | ||||||||||||
4 | return false; | 4 | return false; | |||||||||||||
| 5 | DefaultIntervalCategoryDataset that = (DefaultIntervalCategoryDataset)obj; | ||||||||||||||
5 | if (!(obj instanceof XYImageAnnotation)) |
| 6 | if (!Arrays.equals(this.seriesKeys, that.seriesKeys)) | ||||||||||||
6 | return false; | 7 | return false; | |||||||||||||
7 | XYImageAnnotation that = (XYImageAnnotation)obj; | | ||||||||||||||
8 | if (this.x != that.x) | | ||||||||||||||
9 | return false; |
| | |||||||||||||
10 | if (this.y != that.y) | | ||||||||||||||
11 | return false; |
| | |||||||||||||
12 | if (!ObjectUtilities.equal(this.image, that.image)) | | ||||||||||||||
13 | return false; |
| | |||||||||||||
14 | if (!this.anchor.equals(that.anchor)) |
| 8 | if (!Arrays.equals(this.categoryKeys, that.categoryKeys)) | ||||||||||||
15 | return false; | 9 | return false; |
Row | Violation |
---|---|
1 | Super method call if(!super.equals(obj)) cannot be extracted from method |
2 | Expression Arrays.equals(this.seriesKeys,that.seriesKeys) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched return false; |
4 | Unmatched return false; |
5 | Unmatched return false; |
6 | Expression this.anchor.equals(that.anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression Arrays.equals(this.categoryKeys,that.categoryKeys) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Not all possible execution flows end in a return statement |
9 | The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.XYImageAnnotation and org.jfree.data.category.DefaultIntervalCategoryDataset do not have a common superclass |