File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/CategoryLineAnnotation.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 CategoryLineAnnotation)) {↵ | 4 | if (!(obj instanceof DialTextAnnotation)) {↵ | |
5 | return false;↵ | 5 | return false;↵ | |
6 | }↵ | 6 | }↵ | |
7 | CategoryLineAnnotation that = (CategoryLineAnnotation) obj;↵ | 7 | DialTextAnnotation that = (DialTextAnnotation) obj;↵ | |
8 | if (!this.category1.equals(that.getCategory1())) {↵ | 8 | if (!this.label.equals(that.label)) {↵ | |
9 | return false;↵ | 9 | return false;↵ | |
10 | }↵ | 10 | }↵ | |
11 | if (this.value1 != that.getValue1()) {↵ | 11 | if (!this.font.equals(that.font)) {↵ | |
12 | return false;↵ | 12 | return false;↵ | |
13 | }↵ | 13 | }↵ | |
14 | if (!this.category2.equals(that.getCategory2())) {↵ | 14 | if (!PaintUtilities.equal(this.paint, that.paint)) {↵ | |
15 | return false;↵ | 15 | return false;↵ | |
16 | }↵ | 16 | }↵ | |
17 | if (this.value2 != that.getValue2()) {↵ | 17 | if (this.radius != that.radius) {↵ | |
18 | return false;↵ | 18 | return false;↵ | |
19 | }↵ | 19 | }↵ | |
20 | if (!PaintUtilities.equal(this.paint, that.paint)) {↵ | 20 | if (this.angle != that.angle) {↵ | |
21 | return false;↵ | 21 | return false;↵ | |
22 | }↵ | 22 | }↵ | |
23 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) {↵ | 23 | if (!this.anchor.equals(that.anchor)) {↵ | |
24 | return false;↵ | 24 | return false;↵ | |
25 | }↵ | 25 | }↵ | |
26 | return true; | 26 | 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) | 4.9 |
Clones location | Clones are in different classes |
Number of node comparisons | 101 |
Number of mapped statements | 15 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 6.0 |
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 DialTextAnnotation)) | ||||||||||||||||
4 | return false; | 4 | return false; | |||||||||||||||||
5 | CategoryLineAnnotation that = (CategoryLineAnnotation)obj; |
| 5 | DialTextAnnotation that = (DialTextAnnotation)obj; | ||||||||||||||||
6 | if (!this.category1.equals(that.getCategory1())) |
| 10 | if (!PaintUtilities.equal(this.paint, that.paint)) | ||||||||||||||||
7 | return false; | 11 | return false; | |||||||||||||||||
8 | if (this.value1 != that.getValue1()) |
| 12 | if (this.radius != that.radius) | ||||||||||||||||
9 | return false; | 13 | return false; | |||||||||||||||||
10 | if (!this.category2.equals(that.getCategory2())) |
| | |||||||||||||||||
11 | return false; |
| | |||||||||||||||||
12 | if (this.value2 != that.getValue2()) |
| 14 | if (this.angle != that.angle) | ||||||||||||||||
13 | return false; | 15 | return false; | |||||||||||||||||
14 | if (!PaintUtilities.equal(this.paint, that.paint)) |
| 8 | if (!this.font.equals(that.font)) | ||||||||||||||||
15 | return false; | 9 | return false; | |||||||||||||||||
16 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) |
| 6 | if (!this.label.equals(that.label)) | ||||||||||||||||
17 | return false; | 7 | return false; |
Row | Violation |
---|---|
1 | Expression this.category1.equals(that.getCategory1()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression PaintUtilities.equal(this.paint,that.paint) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression that.getValue1() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement if(!this.category2.equals(that.getCategory2())) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched return false; |
7 | Expression that.getValue2() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression PaintUtilities.equal(this.paint,that.paint) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression this.font.equals(that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression ObjectUtilities.equal(this.stroke,that.stroke) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression this.label.equals(that.label) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | 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.plot.dial.DialTextAnnotation |
14 | Not all possible execution flows end in a return statement |
15 | The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.CategoryLineAnnotation and org.jfree.chart.plot.dial.DialTextAnnotation do not have a common superclass |