if (this == obj) {
return true;
}
if (obj instanceof CategoryTick && super.equals(obj)) {
CategoryTick that = (CategoryTick) obj;
if (!ObjectUtilities.equal(this.category, that.category)) {
return false;
}
if (!ObjectUtilities.equal(this.label, that.label)) {
return false;
}
if (!ObjectUtilities.equal(this.labelAnchor, that.labelAnchor)) {
return false;
}
return true;
}
return false;
if (obj == this) {
return true;
}
if (!(obj instanceof StandardXYURLGenerator)) {
return false;
}
StandardXYURLGenerator that = (StandardXYURLGenerator) obj;
if (!ObjectUtilities.equal(that.prefix, this.prefix)) {
return false;
}
if (!ObjectUtilities.equal(that.seriesParameterName,
this.seriesParameterName)) {
return false;
}
if (!ObjectUtilities.equal(that.itemParameterName,
this.itemParameterName)) {
return false;
}
return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryTick.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/urls/StandardXYURLGenerator.java
|
Method name: boolean equals(Object)
|
|
Method name: boolean equals(Object)
|
Number of AST nodes: 12
|
|
Number of AST nodes: 12
|
|
1 | if (this == obj) {↵ | | 1 | if (obj == this) {↵
|
2 | return true; ↵ | | 2 | return true; ↵
|
3 | }↵ | | 3 | }↵
|
4 | if (obj instanceof CategoryTick && super.equals(obj)) {↵ | | 4 | if (!(obj instanceof StandardXYURLGenerator)) {↵
|
| | | 5 | return false;↵
|
5 | CategoryTick that = (CategoryTick) obj; ↵ | | 6 | ↵
|
6 | ↵ | | 7 | }↵
|
| | | 8 | StandardXYURLGenerator that = (StandardXYURLGenerator) obj;↵
|
7 | if (!ObjectUtilities.equal(this.category, that.category)) {↵ | | 9 | if (!ObjectUtilities.equal(that.prefix, this.prefix)) {↵
|
8 | return false; ↵ | | 10 | return false;↵
|
9 | }↵ | | 11 | ↵
|
10 | ↵ | | 12 | }↵
|
11 | if (!ObjectUtilities.equal(this.label, that.label↵ | | 13 | if (!ObjectUtilities.equal(that.seriesParameterName, ↵
|
12 | )) {↵ | | 14 | this.seriesParameterName)) {↵
|
13 | return false; ↵ | | 15 | return false;↵
|
14 | ↵ | | |
|
15 | }↵ | | 16 | }↵
|
16 | if (!ObjectUtilities.equal(this.labelAnchor, that.labelAnchor)) {↵ | | 17 | if (!ObjectUtilities.equal(that.itemParameterName, ↵
|
17 | return false; ↵ | | 18 | ↵
|
18 | }↵ | | 19 | this.itemParameterName)) {↵
|
19 | return true;↵ | | 20 | return false;↵
|
20 | }↵ | | 21 | }↵
|
21 | return false; | | 22 | 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) | 1.7 |
Clones location | Clones are in different classes |
Number of node comparisons | 18 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.7 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | CategoryTick that = (CategoryTick)obj; | | | |
5 | if (!ObjectUtilities.equal(this.category, that.category)) | | 3 | if (!(obj instanceof StandardXYURLGenerator)) |
6 | | | 4 | |
Precondition Violations (2)
Row |
Violation |
1 | Expression ObjectUtilities.equal(this.category,that.category) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Not all possible execution flows end in a return statement |