File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYPolygonAnnotation.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/MultiplePiePlot.java | |||
Method name: boolean equals(Object)
|
Method name: boolean equals(Object)
|
|||
Number of AST nodes: 16 | Number of AST nodes: 18 | |||
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 MultiplePiePlot)) {↵ | |
6 | return false;↵ | |||
7 | }↵ | |||
8 | MultiplePiePlot that = (MultiplePiePlot) obj;↵ | |||
9 | if (this.dataExtractOrder != that.dataExtractOrder) {↵ | |||
10 | return false;↵ | |||
11 | }↵ | |||
13 | ) {↵ | 12 | if (this.limit != that.limit) {↵ | |
14 | return false; ↵ | 13 | return false;↵ | |
15 | }↵ | 14 | }↵ | |
16 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) {↵ | 15 | if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey)) {↵ | |
17 | return false;↵ | 16 | return false;↵ | |
18 | }↵ | 17 | }↵ | |
19 | if (!PaintUtilities.equal(this.outlinePaint, that.outline↵ | 18 | if (!PaintUtilities.equal(this.aggregatedItemsPaint,↵ | |
20 | Paint)) {↵ | 19 | that.aggregatedItemsPaint)) {↵ | |
21 | return false;↵ | 20 | return false;↵ | |
22 | }↵ | 21 | }↵ | |
23 | if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) {↵ | 22 | if (!ObjectUtilities.equal(this.pieChart, that.pieChart)) {↵ | |
24 | return false;↵ | 23 | return false;↵ | |
25 | }↵ | 24 | }↵ | |
26 | // seem to be the same↵ | 25 | if (!super.equals(obj)) {↵ | |
26 | return false;↵ | |||
27 | }↵ | |||
27 | return true; | 28 |
| |
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 99 |
Number of mapped statements | 13 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 5.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (obj == this) | 1 | if (obj == this) | |||||||||||||||||||||||||||
2 | return true; | 2 | return true; | |||||||||||||||||||||||||||
|
| 6 | if (this.dataExtractOrder != that.dataExtractOrder) | |||||||||||||||||||||||||||
|
| 7 | return false; | |||||||||||||||||||||||||||
|
| 8 | if (this.limit != that.limit) | |||||||||||||||||||||||||||
|
| 9 | return false; | |||||||||||||||||||||||||||
3 | if (!super.equals(obj)) |
| 16 | if (!super.equals(obj)) | ||||||||||||||||||||||||||
4 | return false; | 17 | return false; | |||||||||||||||||||||||||||
5 | if (!(obj instanceof XYPolygonAnnotation)) |
| 3 | if (!(obj instanceof MultiplePiePlot)) | ||||||||||||||||||||||||||
6 | return false; | 4 | return false; | |||||||||||||||||||||||||||
7 | XYPolygonAnnotation that = (XYPolygonAnnotation)obj; |
| 5 | MultiplePiePlot that = (MultiplePiePlot)obj; | ||||||||||||||||||||||||||
8 | if (!Arrays.equals(this.polygon, that.polygon)) |
| 10 | if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey)) | ||||||||||||||||||||||||||
9 | return false; | 11 | return false; | |||||||||||||||||||||||||||
10 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) |
| 14 | if (!ObjectUtilities.equal(this.pieChart, that.pieChart)) | ||||||||||||||||||||||||||
11 | return false; | 15 | return false; | |||||||||||||||||||||||||||
12 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) |
| 12 | if (!PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint)) | ||||||||||||||||||||||||||
13 | return false; | 13 | return false; |
Row | Violation |
---|---|
1 | Unmatched statement if(this.dataExtractOrder != that.dataExtractOrder) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched return false; |
3 | Unmatched statement if(this.limit != that.limit) 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 | Super method call if(!super.equals(obj)) cannot be extracted from method |
6 | Super method call if(!super.equals(obj)) cannot be extracted from method |
7 | Expression Arrays.equals(this.polygon,that.polygon) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression this.aggregatedItemsKey.equals(that.aggregatedItemsKey) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Type java.awt.Stroke of variable this.stroke does not match with type org.jfree.chart.JFreeChart of variable this.pieChart |
10 | Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression that.pieChart cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Type java.awt.Stroke of variable that.stroke does not match with type org.jfree.chart.JFreeChart of variable that.pieChart |
13 | Expression that.outlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression that.aggregatedItemsPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | 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.plot.MultiplePiePlot |
16 | Not all possible execution flows end in a return statement |
17 | The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.XYPolygonAnnotation and org.jfree.chart.plot.MultiplePiePlot do not have a common superclass |