File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/NumberAxis.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: 18 | Number of AST nodes: 16 | |||
1 | if (obj == this) {↵ | 1 | if (obj == this) {↵ | |
2 | return true;↵ | 2 | return true;↵ | |
3 | }↵ | 3 | }↵ | |
4 | if (!(obj instanceof NumberAxis)) {↵ | 4 | if (!super.equals(obj)) {↵ | |
5 | return false;↵ | 5 | return false;↵ | |
6 | }↵ | 6 | }↵ | |
7 | if (!super.equals(obj)) {↵ | 7 | if (!(obj instanceof WaterfallBarRenderer)) {↵ | |
8 | return false;↵ | 8 | return false;↵ | |
9 | }↵ | 9 | }↵ | |
10 | NumberAxis that = (NumberAxis) obj;↵ | 10 | ↵ | |
11 | if (this.autoRangeIncludesZero != that.autoRangeIncludesZero) {↵ | 11 | WaterfallBarRenderer that = (WaterfallBarRenderer) obj;↵ | |
12 | return false;↵ | 12 | ↵ | |
13 | }↵ | |||
14 | if (this.autoRangeStickyZero != that.autoRangeStickyZero) {↵ | 13 | if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint)) {↵ | |
15 | return false;↵ | 14 | return false;↵ | |
16 | }↵ | 15 | }↵ | |
17 | if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) {↵ | 16 | if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint)) {↵ | |
18 | return false;↵ | 17 | return false;↵ | |
19 | }↵ | 18 | }↵ | |
20 | if (!ObjectUtilities.equal(this.numberFormatOverride,↵ | 19 | if (!PaintUtilities.equal(this.positiveBarPaint,↵ | |
21 | that.numberFormatOverride)) {↵ | 20 | that.positiveBarPaint)) {↵ | |
22 | return false;↵ | 21 | return false;↵ | |
23 | }↵ | 22 | }↵ | |
24 | if (!this.rangeType.equals(that.rangeType↵ | 23 | if (!PaintUtilities.equal(this.negativeBarPaint,↵ | |
25 | )) {↵ | 24 | that.negativeBarPaint)) {↵ | |
26 | return false;↵ | 25 | return false;↵ | |
27 | }↵ | 26 | }↵ | |
28 | return true; | 27 |
| |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 105 |
Number of mapped statements | 13 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 7.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 (!(obj instanceof NumberAxis)) |
| 5 | if (!(obj instanceof WaterfallBarRenderer)) | ||||||||||||||||||||||||||||||
4 | return false; | 6 | return false; | |||||||||||||||||||||||||||||||
5 | if (!super.equals(obj)) |
| 3 | if (!super.equals(obj)) | ||||||||||||||||||||||||||||||
6 | return false; | 4 | return false; | |||||||||||||||||||||||||||||||
7 | NumberAxis that = (NumberAxis)obj; |
| 7 | WaterfallBarRenderer that = (WaterfallBarRenderer)obj; | ||||||||||||||||||||||||||||||
8 | if (this.autoRangeIncludesZero != that.autoRangeIncludesZero) |
| | |||||||||||||||||||||||||||||||
9 | return false; |
| | |||||||||||||||||||||||||||||||
10 | if (this.autoRangeStickyZero != that.autoRangeStickyZero) |
| | |||||||||||||||||||||||||||||||
11 | return false; |
| | |||||||||||||||||||||||||||||||
12 | if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) |
| 12 | if (!PaintUtilities.equal(this.positiveBarPaint, that.positiveBarPaint)) | ||||||||||||||||||||||||||||||
13 | return false; | 13 | return false; | |||||||||||||||||||||||||||||||
14 | if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride)) |
| 10 | if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint)) | ||||||||||||||||||||||||||||||
15 | return false; | 11 | return false; | |||||||||||||||||||||||||||||||
16 | if (!this.rangeType.equals(that.rangeType)) |
| 8 | if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint)) | ||||||||||||||||||||||||||||||
17 | 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(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 | Type org.jfree.chart.axis.NumberTickUnit of variable this.tickUnit does not match with type java.awt.Paint of variable this.positiveBarPaint |
8 | Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression that.positiveBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Type org.jfree.chart.axis.NumberTickUnit of variable that.tickUnit does not match with type java.awt.Paint of variable that.positiveBarPaint |
11 | Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities |
12 | Type java.text.NumberFormat of variable this.numberFormatOverride does not match with type java.awt.Paint of variable this.lastBarPaint |
13 | Expression that.numberFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression that.lastBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Type java.text.NumberFormat of variable that.numberFormatOverride does not match with type java.awt.Paint of variable that.lastBarPaint |
16 | Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities |
17 | Expression this.rangeType.equals(that.rangeType) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
18 | Expression PaintUtilities.equal(this.firstBarPaint,that.firstBarPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
19 | Clone fragment #1 returns variable that with type org.jfree.chart.axis.NumberAxis , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.category.WaterfallBarRenderer |
20 | Not all possible execution flows end in a return statement |
21 | The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.NumberAxis and org.jfree.chart.renderer.category.WaterfallBarRenderer do not have a common superclass |