File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYPolygonAnnotation.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYShapeAnnotation.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 | // now try to reject equality↵ | |
5 | if (!super.equals(obj)) {↵ | 5 | if (!super.equals(obj)) {↵ | |
6 | return false;↵ | 6 | return false;↵ | |
7 | }↵ | 7 | }↵ | |
8 | if (!(obj instanceof XYPolygonAnnotation)) {↵ | 8 | if (!(obj instanceof XYShapeAnnotation)) {↵ | |
9 | return false;↵ | 9 | return false;↵ | |
10 | }↵ | 10 | }↵ | |
11 | XYPolygonAnnotation that = (XYPolygonAnnotation) obj;↵ | 11 | XYShapeAnnotation that = (XYShapeAnnotation) obj;↵ | |
12 | if (!Arrays.equals(this.polygon, that.polygon)) {↵ | 12 | if (!this.shape.equals(that.shape)) {↵ | |
13 | return false; ↵ | 13 | return false;↵ | |
14 | }↵ | 14 | }↵ | |
15 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) {↵ | 15 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) {↵ | |
16 | return false;↵ | 16 | return false;↵ | |
17 | }↵ | 17 | }↵ | |
18 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {↵ | 18 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {↵ | |
19 | return false;↵ | 19 | return false;↵ | |
20 | }↵ | 20 | }↵ | |
21 | if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) {↵ | 21 | if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) {↵ | |
22 | return false;↵ | 22 | return false;↵ | |
23 | }↵ | 23 | }↵ | |
24 | // seem to be the same↵ | 24 | // seem to be the same↵ | |
25 | 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) | 5.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 110 |
Number of mapped statements | 16 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 5.5 |
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 (!super.equals(obj)) | ||||||||||||||||
4 | return false; | 4 | return false; | |||||||||||||||||
5 | if (!(obj instanceof XYPolygonAnnotation)) |
| 5 | if (!(obj instanceof XYShapeAnnotation)) | ||||||||||||||||
6 | return false; | 6 | return false; | |||||||||||||||||
7 | XYPolygonAnnotation that = (XYPolygonAnnotation)obj; |
| 7 | XYShapeAnnotation that = (XYShapeAnnotation)obj; | ||||||||||||||||
8 | if (!Arrays.equals(this.polygon, that.polygon)) |
| 8 | if (!this.shape.equals(that.shape)) | ||||||||||||||||
9 | return false; | 9 | return false; | |||||||||||||||||
10 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) |
| 10 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) | ||||||||||||||||
11 | return false; | 11 | return false; | |||||||||||||||||
12 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) |
| 12 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) | ||||||||||||||||
13 | return false; | 13 | return false; | |||||||||||||||||
14 | if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) |
| 14 | if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) | ||||||||||||||||
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 | Super method call if(!super.equals(obj)) cannot be extracted from method |
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.shape.equals(that.shape) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression that.stroke cannot be unified with expression that.stroke , because common superclass org.jfree.chart.annotations.AbstractXYAnnotation does not declare member(s) private transient java.awt.Stroke stroke |
6 | Expression that.outlinePaint cannot be unified with expression that.outlinePaint , because common superclass org.jfree.chart.annotations.AbstractXYAnnotation does not declare member(s) private transient java.awt.Paint outlinePaint |
7 | Expression that.fillPaint cannot be unified with expression that.fillPaint , because common superclass org.jfree.chart.annotations.AbstractXYAnnotation does not declare member(s) private transient java.awt.Paint fillPaint |