File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYImageAnnotation.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/entity/PieSectionEntity.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...↵ | |||
5 | if (!super.equals(obj)) {↵ | |||
6 | return false;↵ | |||
7 | }↵ | |||
8 | if (!(obj instanceof XYImageAnnotation)) {↵ | 4 | if (!(obj instanceof PieSectionEntity)) {↵ | |
9 | return false;↵ | 5 | return false;↵ | |
10 | }↵ | 6 | }↵ | |
11 | XYImageAnnotation that = (XYImageAnnotation) obj;↵ | 7 | ↵ | |
12 | if (this.x != that.x↵ | 8 | PieSectionEntity that = (PieSectionEntity) obj;↵ | |
13 | ) {↵ | 9 | if (!ObjectUtilities.equal(this.dataset, that.dataset)) {↵ | |
14 | return false;↵ | 10 | return false;↵ | |
15 | }↵ | 11 | }↵ | |
16 | if (this.y != that.y) {↵ | 12 | if (this.pieIndex != that.pieIndex) {↵ | |
17 | return false;↵ | 13 | return false;↵ | |
18 | }↵ | 14 | }↵ | |
19 | if (!ObjectUtilities.equal(this.image, that.image)) {↵ | 15 | if (this.sectionIndex != that.sectionIndex) {↵ | |
20 | return false;↵ | 16 | return false;↵ | |
21 | }↵ | 17 | }↵ | |
22 | if (!this.anchor.equals(that.anchor)) {↵ | 18 | if (!ObjectUtilities.equal(this.sectionKey, that.sectionKey)) {↵ | |
23 | return false;↵ | 19 | return false;↵ | |
24 | }↵ | 20 | }↵ | |
25 | // seems to be the same...↵ | 21 | ↵ | |
26 | return true; | 22 | 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) | 3.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 76 |
Number of mapped statements | 13 |
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) | 4.3 |
Clone type | Type 2 |
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 PieSectionEntity)) | ||||||||||||||||||||||||||
4 | return false; | 4 | return false; | |||||||||||||||||||||||||||
| 5 | PieSectionEntity that = (PieSectionEntity)obj; | ||||||||||||||||||||||||||||
5 | if (!(obj instanceof XYImageAnnotation)) |
| 6 | if (!ObjectUtilities.equal(this.dataset, that.dataset)) | ||||||||||||||||||||||||||
6 | return false; | 7 | return false; | |||||||||||||||||||||||||||
7 | XYImageAnnotation that = (XYImageAnnotation)obj; | | ||||||||||||||||||||||||||||
8 | if (this.x != that.x) |
| 8 | if (this.pieIndex != that.pieIndex) | ||||||||||||||||||||||||||
9 | return false; | 9 | return false; | |||||||||||||||||||||||||||
10 | if (this.y != that.y) |
| 10 | if (this.sectionIndex != that.sectionIndex) | ||||||||||||||||||||||||||
11 | return false; | 11 | return false; | |||||||||||||||||||||||||||
12 | if (!ObjectUtilities.equal(this.image, that.image)) |
| 12 | if (!ObjectUtilities.equal(this.sectionKey, that.sectionKey)) | ||||||||||||||||||||||||||
13 | return false; | 13 | return false; | |||||||||||||||||||||||||||
16 | return true; |
| 14 | return super.equals(obj); |
Row | Violation |
---|---|
1 | Super method call if(!super.equals(obj)) cannot be extracted from method |
2 | Expression ObjectUtilities.equal(this.dataset,that.dataset) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Type double of variable this.x does not match with type int of variable this.pieIndex |
4 | Expression that.x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression that.pieIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Type double of variable that.x does not match with type int of variable that.pieIndex |
7 | Type double of variable this.y does not match with type int of variable this.sectionIndex |
8 | Expression that.y cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression that.sectionIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Type double of variable that.y does not match with type int of variable that.sectionIndex |
11 | Type java.awt.Image of variable this.image does not match with type java.lang.Comparable of variable this.sectionKey |
12 | Expression that.image cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression that.sectionKey cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Type java.awt.Image of variable that.image does not match with type java.lang.Comparable of variable that.sectionKey |
15 | Super method call return super.equals(obj); cannot be extracted from method |
16 | Not all possible execution flows end in a return statement |
17 | The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.XYImageAnnotation and org.jfree.chart.entity.PieSectionEntity do not have a common superclass |