File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYPolygonAnnotation.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/DateAxis.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)) {↵ | |||
6 | return false;↵ | |||
7 | }↵ | |||
8 | if (!(obj instanceof XYPolygonAnnotation)) {↵ | 4 | if (!(obj instanceof DateAxis)) {↵ | |
9 | return false;↵ | 5 | return false;↵ | |
10 | }↵ | 6 | }↵ | |
11 | XYPolygonAnnotation that = (XYPolygonAnnotation) obj;↵ | 7 | DateAxis that = (DateAxis) obj;↵ | |
12 | if (!Arrays.equals(this.polygon, that.polygon)) {↵ | 8 | if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) {↵ | |
13 | return false; ↵ | 9 | return false;↵ | |
14 | }↵ | 10 | }↵ | |
15 | if (!ObjectUtilities.equal(this.stroke, that.strok↵ | 11 | if (!ObjectUtilities.equal(this.dateFormatOverride,↵ | |
16 | e)) {↵ | 12 | that.dateFormatOverride)) {↵ | |
17 | return false;↵ | 13 | return false;↵ | |
18 | }↵ | 14 | }↵ | |
19 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint↵ | 15 | if (!ObjectUtilities.equal(this.tickMarkPosition,↵ | |
20 | )) {↵ | 16 | that.tickMarkPosition)) {↵ | |
21 | return false;↵ | 17 | return false;↵ | |
22 | }↵ | 18 | }↵ | |
23 | if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) {↵ | 19 | if (!ObjectUtilities.equal(this.timeline, that.timeline)) {↵ | |
24 | return false;↵ | 20 | return false;↵ | |
25 | }↵ | 21 | }↵ | |
26 | // seem to be the same↵ | 22 | if (!super.equals(obj)) {↵ | |
23 | return false;↵ | |||
24 | }↵ | |||
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.7 |
Clones location | Clones are in different classes |
Number of node comparisons | 116 |
Number of mapped statements | 14 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 6.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (obj == this) | 1 | if (obj == this) | |||||||||||||||||||||||||||||||
2 | return true; | 2 | return true; | |||||||||||||||||||||||||||||||
|
| 6 | if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) | |||||||||||||||||||||||||||||||
|
| 7 | return false; | |||||||||||||||||||||||||||||||
3 | if (!super.equals(obj)) |
| 14 | if (!super.equals(obj)) | ||||||||||||||||||||||||||||||
4 | return false; | 15 | return false; | |||||||||||||||||||||||||||||||
5 | if (!(obj instanceof XYPolygonAnnotation)) |
| 3 | if (!(obj instanceof DateAxis)) | ||||||||||||||||||||||||||||||
6 | return false; | 4 | return false; | |||||||||||||||||||||||||||||||
7 | XYPolygonAnnotation that = (XYPolygonAnnotation)obj; |
| 5 | DateAxis that = (DateAxis)obj; | ||||||||||||||||||||||||||||||
8 | if (!Arrays.equals(this.polygon, that.polygon)) |
| | |||||||||||||||||||||||||||||||
9 | return false; |
| | |||||||||||||||||||||||||||||||
10 | if (!ObjectUtilities.equal(this.stroke, that.stroke)) |
| 10 | if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition)) | ||||||||||||||||||||||||||||||
11 | return false; | 11 | return false; | |||||||||||||||||||||||||||||||
12 | if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) |
| 12 | if (!ObjectUtilities.equal(this.timeline, that.timeline)) | ||||||||||||||||||||||||||||||
13 | return false; | 13 | return false; | |||||||||||||||||||||||||||||||
14 | if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) |
| 8 | if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride)) | ||||||||||||||||||||||||||||||
15 | return false; | 9 | return false; | |||||||||||||||||||||||||||||||
16 | return true; | 16 | return true; |
Row | Violation |
---|---|
1 | Unmatched statement if(!ObjectUtilities.equal(this.tickUnit,that.tickUnit)) 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 | Super method call if(!super.equals(obj)) cannot be extracted from method |
4 | Super method call if(!super.equals(obj)) cannot be extracted from method |
5 | 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 |
6 | Unmatched return false; |
7 | Type java.awt.Stroke of variable this.stroke does not match with type org.jfree.chart.axis.DateTickMarkPosition of variable this.tickMarkPosition |
8 | Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression that.tickMarkPosition cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Type java.awt.Stroke of variable that.stroke does not match with type org.jfree.chart.axis.DateTickMarkPosition of variable that.tickMarkPosition |
11 | Type java.awt.Paint of variable this.outlinePaint does not match with type org.jfree.chart.axis.Timeline of variable this.timeline |
12 | Expression that.outlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression that.timeline cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Type java.awt.Paint of variable that.outlinePaint does not match with type org.jfree.chart.axis.Timeline of variable that.timeline |
15 | Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities |
16 | Type java.awt.Paint of variable this.fillPaint does not match with type java.text.DateFormat of variable this.dateFormatOverride |
17 | Expression that.fillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
18 | Expression that.dateFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted |
19 | Type java.awt.Paint of variable that.fillPaint does not match with type java.text.DateFormat of variable that.dateFormatOverride |
20 | Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities |
21 | 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.DateAxis |
22 | Not all possible execution flows end in a return statement |
23 | The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.XYPolygonAnnotation and org.jfree.chart.axis.DateAxis do not have a common superclass |