File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYPolygonAnnotation.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/MeterInterval.java | |||
Method name: boolean equals(Object)
|
Method name: boolean equals(Object)
|
|||
Number of AST nodes: 16 | Number of AST nodes: 16 | |||
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 XYPolygonAnnotation)) {↵ | |||
9 | return false;↵ | |||
10 | }↵ | |||
11 | XYPolygonAnnotation that = (XYPolygonAnnotation) obj;↵ | |||
12 | if (!Arrays.equals(this.polygon, that.polygon↵ | 5 | if (!(obj instanceof MeterInterval)) {↵ | |
6 | return false;↵ | |||
7 | }↵ | |||
8 | MeterInterval that = (MeterInterval) obj;↵ | |||
9 | if (!this.label.equals(that.label)) {↵ | |||
10 | return false;↵ | |||
11 | }↵ | |||
13 | )) {↵ | 12 | if (!this.range.equals(that.range)) {↵ | |
14 | return false; ↵ | 13 | return false;↵ | |
15 | }↵ | 14 | }↵ | |
16 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) {↵ | 15 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {↵ | |
17 | return false;↵ | 16 | return false;↵ | |
18 | }↵ | 17 | }↵ | |
19 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {↵ | 18 | if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke)) {↵ | |
20 | return false;↵ | 19 | return false;↵ | |
21 | }↵ | 20 | }↵ | |
22 | if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) {↵ | 21 | if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {↵ | |
23 | return false;↵ | 22 | return false;↵ | |
24 | }↵ | 23 | }↵ | |
25 | // seem to be the same↵ | |||
26 | return true; | 24 |
| |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 110 |
Number of mapped statements | 15 |
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) | 7.4 |
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 MeterInterval)) | |||||||||||||||||||
4 | return false; | 4 | return false; | ||||||||||||||||||||
| 5 | MeterInterval that = (MeterInterval)obj; | |||||||||||||||||||||
5 | if (!(obj instanceof XYPolygonAnnotation)) |
| 6 | if (!this.label.equals(that.label)) | |||||||||||||||||||
6 | return false; | 7 | return false; | ||||||||||||||||||||
7 | XYPolygonAnnotation that = (XYPolygonAnnotation)obj; | | |||||||||||||||||||||
8 | if (!Arrays.equals(this.polygon, that.polygon)) |
| 8 | if (!this.range.equals(that.range)) | |||||||||||||||||||
9 | return false; | 9 | return false; | ||||||||||||||||||||
10 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) |
| 12 | if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke)) | |||||||||||||||||||
11 | return false; | 13 | return false; | ||||||||||||||||||||
12 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) |
| 10 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) | |||||||||||||||||||
13 | return false; | 11 | return false; | ||||||||||||||||||||
14 | if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) |
| 14 | if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) | |||||||||||||||||||
15 | return false; | 15 | return false; | ||||||||||||||||||||
16 | return true; | 16 | return true; |
Row | Violation |
---|---|
1 | Super method call if(!super.equals(obj)) cannot be extracted from method |
2 | Expression this.label.equals(that.label) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression Arrays.equals(this.polygon,that.polygon) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression this.range.equals(that.range) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Type java.awt.Stroke of variable that.stroke does not match with type java.awt.Stroke of variable that.outlineStroke |
6 | Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression that.outlineStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Type java.awt.Paint of variable that.outlinePaint does not match with type java.awt.Paint of variable that.outlinePaint |
9 | Type java.awt.Paint of variable that.fillPaint does not match with type java.awt.Paint of variable that.backgroundPaint |
10 | Expression that.fillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.XYPolygonAnnotation and org.jfree.chart.plot.MeterInterval do not have a common superclass |