for (int item = 0; item < urlCount; item++) {
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;
}
}
}
for (int item = 0; item < urlCount; item++) {
String u1 = getURL(series, item);
String u2 = that.getURL(series, item);
if (u1 != null) {
if (!u1.equals(u2)) {
return false;
}
}
else {
if (u2 != null) {
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/chart/urls/CustomXYURLGenerator.java
|
Method name: boolean equals(Object)
|
|
Method name: boolean equals(Object)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | for (int item = 0; item < urlCount; item++) {↵ | | 1 | for (int item = 0; item < urlCount; item++) {↵
|
2 | String u1 = getURL(series, item);↵ | | 2 | String u1 = getURL(series, item);↵
|
3 | String u2 = generator.getURL(series, item);↵ | | 3 | String u2 = that.getURL(series, item);↵
|
4 | if (u1 != null) {↵ | | 4 | if (u1 != null) {↵
|
5 | if (!u1.equals(u2)) {↵ | | 5 | if (!u1.equals(u2)) {↵
|
6 | return false;↵ | | 6 | return false;↵
|
7 | }↵ | | 7 | }↵
|
8 | }↵ | | 8 | }↵
|
9 | else {↵ | | 9 | else {↵
|
10 | if (u2 != null) {↵ | | 10 | if (u2 != null) {↵
|
11 | return false;↵ | | 11 | return false;↵
|
12 | }↵ | | 12 | }↵
|
13 | }↵ | | 13 | }↵
|
14 | } | | 14 | }
|
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.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 22 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 8 |
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) | 3.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
13 | for (int item = 0; item < urlCount; item++) | | 13 | for (int item = 0; item < urlCount; item++) |
14 | String u1 = getURL(series, item); | | 14 | String u1 = getURL(series, item); |
15 | String u2 = generator.getURL(series, item); | | 15 | String u2 = that.getURL(series, item); |
16 | | | 16 | |
17 | | | 17 | |
18 | | | 18 | |
| | | | |
19 | | | 19 | |
20 | | | 20 | |
Precondition Violations (2)
Row |
Violation |
1 | Expression generator cannot be unified with expression that , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public java.lang.String getURL(int, int) |
2 | Not all possible execution flows end in a return statement |