String u1 = getURL(series, item);
String u2 = generator.getURL(series, item);
if (u1 != null) {
if (!u1.equals(u2)) {
return false;
}
} else {
if (u2 != null) {
return false;
}
}
Object v1 = getObject(r, c);
Object v2 = that.getObject(r, c);
if (v1 == null) {
if (v2 != null) {
return false;
}
}
else {
if (!v1.equals(v2)) {
return false;
}
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/urls/CustomCategoryURLGenerator.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/data/KeyedObjects2D.java
|
Method name: boolean equals(Object)
|
|
Method name: boolean equals(Object)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | String u1 = getURL(series, item);↵ | | |
|
2 | String u2 = generator.getURL(series, item↵ | | 1 | Object v1 = getObject(r, c);↵
|
3 | );↵ | | 2 | Object v2 = that.getObject(r, c);↵
|
4 | if (u1 != null) {↵ | | 3 | if (v1 == null) {↵
|
5 | if (!u1.equals(u2)) {↵ | | 4 | if (v2 != null) {↵
|
6 | return false;↵ | | 5 | return false;↵
|
7 | }↵ | | 6 | }↵
|
8 | }↵ | | 7 | }↵
|
9 | else {↵ | | 8 | else {↵
|
10 | if (u2 != null) {↵ | | 9 | if (!v1.equals(v2)) {↵
|
11 | return false;↵ | | 10 | return false;↵
|
12 | }↵ | | 11 | }↵
|
13 | } | | 12 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 2 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 2 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 11 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
17 | if (!u1.equals(u2)) | | 23 | if (!v1.equals(v2)) |
18 | | | 24 | |
Precondition Violations (3)
Row |
Violation |
1 | Type java.lang.String of variable u2 does not match with type java.lang.Object of variable v2 |
2 | Type java.lang.String of variable u1 does not match with type java.lang.Object of variable v1 |
3 | Not all possible execution flows end in a return statement |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
19 | if (u2 != null) | | 21 | if (v2 != null) |
20 | | | 22 | |
Precondition Violations (2)
Row |
Violation |
1 | Type java.lang.String of variable u2 does not match with type java.lang.Object of variable v2 |
2 | Not all possible execution flows end in a return statement |