File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYShapeAnnotation.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 XYShapeAnnotation)) {↵ | |||
9 | return false;↵ | |||
10 | }↵ | |||
11 | XYShapeAnnotation that = (XYShapeAnnotation) obj;↵ | 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 | }↵ | |||
12 | if (!this.shape.equals(that.shape)) {↵ | 12 | if (!this.range.equals(that.range)) {↵ | |
13 | return false;↵ | 13 | return false;↵ | |
14 | }↵ | 14 | }↵ | |
15 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) {↵ | 15 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {↵ | |
16 | return false;↵ | 16 | return false;↵ | |
17 | }↵ | 17 | }↵ | |
18 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {↵ | 18 | if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke)) {↵ | |
19 | return false;↵ | 19 | return false;↵ | |
20 | }↵ | 20 | }↵ | |
21 | if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) {↵ | 21 | if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {↵ | |
22 | return false;↵ | 22 | return false;↵ | |
23 | }↵ | 23 | }↵ | |
24 | // seem to be the same↵ | |||
25 | 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.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 119 |
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) | 4.2 |
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 XYShapeAnnotation)) |
| 6 | if (!this.label.equals(that.label)) | |||||||||||||||||||||||||||
6 | return false; | 7 | return false; | ||||||||||||||||||||||||||||
7 | XYShapeAnnotation that = (XYShapeAnnotation)obj; | | |||||||||||||||||||||||||||||
8 | if (!this.shape.equals(that.shape)) |
| 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 | Type java.awt.Shape of variable that.shape does not match with type org.jfree.data.Range of variable that.range |
4 | Expression that.shape cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression that.range cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Type java.awt.Shape of variable that.shape does not match with type org.jfree.data.Range of variable that.range |
7 | Type java.awt.Shape of variable this.shape does not match with type org.jfree.data.Range of variable this.range |
8 | Type java.awt.Stroke of variable that.stroke does not match with type java.awt.Stroke of variable that.outlineStroke |
9 | Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression that.outlineStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Type java.awt.Paint of variable that.outlinePaint does not match with type java.awt.Paint of variable that.outlinePaint |
12 | Type java.awt.Paint of variable that.fillPaint does not match with type java.awt.Paint of variable that.backgroundPaint |
13 | Expression that.fillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.XYShapeAnnotation and org.jfree.chart.plot.MeterInterval do not have a common superclass |