File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYPolygonAnnotation.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/NumberAxis.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)) {↵ | 5 | if (!(obj instanceof NumberAxis)) {↵ | |
6 | return false;↵ | 6 | return false;↵ | |
7 | }↵ | 7 | }↵ | |
8 | if (!(obj instanceof XYPolygonAnnotation)) {↵ | 8 | if (!super.equals(obj)) {↵ | |
9 | return false;↵ | 9 | return false;↵ | |
10 | }↵ | 10 | }↵ | |
11 | XYPolygonAnnotation that = (XYPolygonAnnotation) obj;↵ | 11 | NumberAxis that = (NumberAxis) obj;↵ | |
12 | if (!Arrays.equals(this.polygon, that.polygon)) {↵ | 12 | if (this.autoRangeIncludesZero != that.autoRangeIncludesZero) {↵ | |
13 | return false; ↵ | 13 | return false;↵ | |
14 | }↵ | 14 | }↵ | |
15 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) {↵ | 15 | if (this.autoRangeStickyZero != that.autoRangeStickyZero) {↵ | |
16 | return false;↵ | 16 | return false;↵ | |
17 | }↵ | 17 | }↵ | |
18 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {↵ | 18 | if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) {↵ | |
19 | return false;↵ | 19 | return false;↵ | |
20 | }↵ | 20 | }↵ | |
21 | if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) {↵ | 21 | if (!ObjectUtilities.equal(this.↵ | |
22 | return false;↵ | |||
23 | }↵ | |||
24 | // seem to be the same↵ | 22 | numberFormatOverride,↵ | |
23 | that.numberFormatOverride)) {↵ | |||
24 | return false;↵ | |||
25 | }↵ | |||
26 | if (!this.rangeType.equals(that.rangeType)) {↵ | |||
27 | return false;↵ | |||
28 | }↵ | |||
25 | return true; | 29 |
| |
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.0 |
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) | 7.1 |
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)) |
| 5 | if (!super.equals(obj)) | ||||||||||||||||||||||||||||||
4 | return false; | 6 | return false; | |||||||||||||||||||||||||||||||
5 | if (!(obj instanceof XYPolygonAnnotation)) |
| 3 | if (!(obj instanceof NumberAxis)) | ||||||||||||||||||||||||||||||
6 | return false; | 4 | return false; | |||||||||||||||||||||||||||||||
7 | XYPolygonAnnotation that = (XYPolygonAnnotation)obj; |
| 7 | NumberAxis that = (NumberAxis)obj; | ||||||||||||||||||||||||||||||
|
| 8 | if (this.autoRangeIncludesZero != that.autoRangeIncludesZero) | |||||||||||||||||||||||||||||||
|
| 9 | return false; | |||||||||||||||||||||||||||||||
|
| 10 | if (this.autoRangeStickyZero != that.autoRangeStickyZero) | |||||||||||||||||||||||||||||||
|
| 11 | return false; | |||||||||||||||||||||||||||||||
8 | if (!Arrays.equals(this.polygon, that.polygon)) |
| 16 | if (!this.rangeType.equals(that.rangeType)) | ||||||||||||||||||||||||||||||
9 | return false; | 17 | return false; | |||||||||||||||||||||||||||||||
10 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) |
| 12 | if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) | ||||||||||||||||||||||||||||||
11 | return false; | 13 | return false; | |||||||||||||||||||||||||||||||
12 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) |
| 14 | if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride)) | ||||||||||||||||||||||||||||||
13 | return false; | 15 | 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(this.autoRangeIncludesZero != that.autoRangeIncludesZero) 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 | Unmatched statement if(this.autoRangeStickyZero != that.autoRangeStickyZero) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched return false; |
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.rangeType.equals(that.rangeType) 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.axis.NumberTickUnit of variable this.tickUnit |
10 | Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression that.tickUnit 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.axis.NumberTickUnit of variable that.tickUnit |
13 | Type java.awt.Paint of variable this.outlinePaint does not match with type java.text.NumberFormat of variable this.numberFormatOverride |
14 | Expression that.outlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Expression that.numberFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Type java.awt.Paint of variable that.outlinePaint does not match with type java.text.NumberFormat of variable that.numberFormatOverride |
17 | Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities |
18 | 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.axis.NumberAxis |
19 | Not all possible execution flows end in a return statement |
20 | The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.XYPolygonAnnotation and org.jfree.chart.axis.NumberAxis do not have a common superclass |