File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/CategoryLineAnnotation.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYDifferenceRenderer.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 XYDifferenceRenderer)) {↵ | |
5 | return false;↵ | 5 | return false;↵ | |
6 | }↵ | 6 | ↵ | |
7 | CategoryLineAnnotation that = (CategoryLineAnnotation) obj;↵ | 7 | ↵ | |
8 | if (!this.category1.equals(that.getCategory1()↵ | 8 | }↵ | |
9 | )) {↵ | 9 | if (!super.equals(obj)) {↵ | |
10 | return false;↵ | 10 | return false; ↵ | |
11 | }↵ | 11 | }↵ | |
12 | if (this.value1 != that.getValue1(↵ | 12 | XYDifferenceRenderer that = (XYDifferenceRenderer) obj;↵ | |
13 | )) {↵ | 13 | if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) {↵ | |
14 | return false;↵ | 14 | return false; ↵ | |
15 | }↵ | 15 | }↵ | |
16 | if (!this.category2.equals(that.getCategory2())) {↵ | 16 | if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) {↵ | |
17 | return false;↵ | 17 | return false; ↵ | |
18 | }↵ | 18 | }↵ | |
19 | if (this.value2 != that.getValue2()) {↵ | 19 | if (this.shapesVisible != that.shapesVisible) {↵ | |
20 | return false;↵ | 20 | return false; ↵ | |
21 | }↵ | 21 | }↵ | |
22 | if (!PaintUtilities.equal(this.paint, that.paint)) {↵ | 22 | if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) {↵ | |
23 | return false;↵ | 23 | return false; ↵ | |
24 | }↵ | 24 | }↵ | |
25 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) {↵ | 25 | if (this.roundXCoordinates != that.roundXCoordinates) {↵ | |
26 | return false;↵ | 26 | return false;↵ | |
27 | }↵ | 27 | }↵ | |
28 | return true; | 28 |
| |
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.7 |
Clones location | Clones are in different classes |
Number of node comparisons | 113 |
Number of mapped statements | 12 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 5.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 XYDifferenceRenderer)) | ||||||||||||||||||||||||||||||
4 | return false; | 4 | return false; | |||||||||||||||||||||||||||||||
5 | CategoryLineAnnotation that = (CategoryLineAnnotation)obj; | | ||||||||||||||||||||||||||||||||
6 | if (!this.category1.equals(that.getCategory1())) |
| 5 | if (!super.equals(obj)) | ||||||||||||||||||||||||||||||
7 | return false; | 6 | return false; | |||||||||||||||||||||||||||||||
| 7 | XYDifferenceRenderer that = (XYDifferenceRenderer)obj; | ||||||||||||||||||||||||||||||||
8 | if (this.value1 != that.getValue1()) | | ||||||||||||||||||||||||||||||||
9 | return false; |
| | |||||||||||||||||||||||||||||||
10 | if (!this.category2.equals(that.getCategory2())) |
| 10 | if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) | ||||||||||||||||||||||||||||||
11 | return false; | 11 | return false; | |||||||||||||||||||||||||||||||
12 | if (this.value2 != that.getValue2()) | | ||||||||||||||||||||||||||||||||
13 | return false; |
| | |||||||||||||||||||||||||||||||
14 | if (!PaintUtilities.equal(this.paint, that.paint)) |
| 8 | if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) | ||||||||||||||||||||||||||||||
15 | return false; | 9 | return false; | |||||||||||||||||||||||||||||||
| 12 | if (this.shapesVisible != that.shapesVisible) | ||||||||||||||||||||||||||||||||
|
| 13 | return false; | |||||||||||||||||||||||||||||||
16 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) |
| 14 | if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) | ||||||||||||||||||||||||||||||
17 | return false; | 15 | 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 | Super method call if(!super.equals(obj)) cannot be extracted from method |
3 | Unmatched return false; |
4 | Expression this.category2.equals(that.getCategory2()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression PaintUtilities.equal(this.negativePaint,that.negativePaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Unmatched return false; |
7 | Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression that.positivePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Unmatched return false; |
10 | Type java.awt.Stroke of variable this.stroke does not match with type java.awt.Shape of variable this.legendLine |
11 | Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression that.legendLine cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Type java.awt.Stroke of variable that.stroke does not match with type java.awt.Shape of variable that.legendLine |
14 | Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.ShapeUtilities |
15 | Not all possible execution flows end in a return statement |
16 | The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.CategoryLineAnnotation and org.jfree.chart.renderer.xy.XYDifferenceRenderer do not have a common superclass |