File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYPolygonAnnotation.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 XYPolygonAnnotation)) {↵ | 7 | if (!(obj instanceof WaterfallBarRenderer)) {↵ | |
9 | return false;↵ | 8 | return false;↵ | |
10 | }↵ | 9 | }↵ | |
11 | XYPolygonAnnotation that = (XYPolygonAnnotation) obj;↵ | 10 | WaterfallBarRenderer that = (WaterfallBarRenderer) obj;↵ | |
12 | if (!Arrays.equals(this.polygon, that.polygon)) {↵ | 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) | 6.8 |
Clones location | Clones are in different classes |
Number of node comparisons | 98 |
Number of mapped statements | 13 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 5.6 |
Clone type | Type 3 |
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 WaterfallBarRenderer)) | ||||||||||||||||||||||||||||||
6 | return false; | 6 | return false; | |||||||||||||||||||||||||||||||
7 | XYPolygonAnnotation that = (XYPolygonAnnotation)obj; |
| 7 | WaterfallBarRenderer that = (WaterfallBarRenderer)obj; | ||||||||||||||||||||||||||||||
8 | if (!Arrays.equals(this.polygon, that.polygon)) |
| | |||||||||||||||||||||||||||||||
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)) |
| 8 | if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint)) | ||||||||||||||||||||||||||||||
15 | return false; | 9 | return false; |
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 | Unmatched statement if(!Arrays.equals(this.polygon,that.polygon)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched return false; |
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.firstBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Clone fragment #1 returns variable that with type org.jfree.chart.annotations.XYPolygonAnnotation , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.category.WaterfallBarRenderer |
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.XYPolygonAnnotation and org.jfree.chart.renderer.category.WaterfallBarRenderer do not have a common superclass |