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