if (obj == this) {
return true;
}
if (!(obj instanceof NumberTickUnit)) {
return false;
}
if (!super.equals(obj)) {
return false;
}
NumberTickUnit that = (NumberTickUnit) obj;
if (!this.formatter.equals(that.formatter)) {
return false;
}
return true;
if (obj == null) {
return false;
}
if (obj == this) {
return true;
}
if (!(obj instanceof HistogramType)) {
return false;
}
HistogramType t = (HistogramType) obj;
if (!this.name.equals(t.name)) {
return false;
}
return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/NumberTickUnit.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/data/statistics/HistogramType.java
|
Method name: boolean equals(Object)
|
|
Method name: boolean equals(Object)
|
Number of AST nodes: 10
|
|
Number of AST nodes: 10
|
|
1 | if (obj == this) {↵ | | 1 | if (obj == null) {↵
|
2 | return true;↵ | | 2 | return false; ↵
|
3 | }↵ | | 3 | }↵
|
| | | 4 | ↵
|
4 | if (!(obj instanceof NumberTickUnit)) {↵ | | 5 | if (obj == this) {↵
|
5 | return false;↵ | | 6 | return true;↵
|
6 | }↵ | | 7 | }↵
|
7 | if (!super.equals(obj↵ | | 8 | ↵
|
8 | )) {↵ | | 9 | if (!(obj instanceof HistogramType)) {↵
|
9 | return false;↵ | | 10 | return false;↵
|
10 | }↵ | | 11 | }↵
|
11 | NumberTickUnit that = (NumberTickUnit↵ | | 12 | ↵
|
12 | ) obj;↵ | | 13 | HistogramType t = (HistogramType) obj;↵
|
13 | if (!this.formatter.equals(that.formatter)) {↵ | | 14 | if (!this.name.equals(t.name)) {↵
|
14 | return false;↵ | | 15 | return false;↵
|
15 | }↵ | | 16 | }↵
|
| | | 17 | ↵
|
16 | return true; | | 18 | return true;
|
See real code fragment |
|
See real code fragment |
Summary
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) | 0.9 |
Clones location | Clones are in different classes |
Number of node comparisons | 28 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (obj == this) | | 3 | if (obj == this) |
2 | | | 4 | |
3 | if (!(obj instanceof NumberTickUnit)) | | 5 | if (!(obj instanceof HistogramType)) |
4 | | | 6 | |
| | | 7 | HistogramType t = (HistogramType)obj; |
5 | if (!super.equals(obj)) | | 8 | if (!this.name.equals(t.name)) |
6 | | | 9 | |
Precondition Violations (5)
Row |
Violation |
1 | Type org.jfree.chart.axis.NumberTickUnit does not match with type org.jfree.data.statistics.HistogramType |
2 | Expression this.name.equals(t.name) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Super method call if(!super.equals(obj)) cannot be extracted from method |
4 | Not all possible execution flows end in a return statement |
5 | The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.NumberTickUnit and org.jfree.data.statistics.HistogramType do not have a common superclass |