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: 12 | Number of AST nodes: 12 | |||
1 | for (int series = 0; series < listCount; series++) {↵ | 1 | for (int series = 0; series < listCount; series++) {↵ | |
2 | int urlCount = getURLCount(series);↵ | 2 | int urlCount = getURLCount(series);↵ | |
3 | if (urlCount != generator.getURLCount(series)) {↵ | 3 | if (urlCount != that.getURLCount(series)) {↵ | |
4 | return false;↵ | 4 | return false;↵ | |
5 | }↵ | 5 | }↵ | |
6 | for (int item = 0; item < urlCount; item++) {↵ | 6 | for (int item = 0; item < urlCount; item++) {↵ | |
7 | String u1 = getURL(series, item);↵ | 7 | String u1 = getURL(series, item);↵ | |
8 | String u2 = generator.getURL(series, item);↵ | 8 | String u2 = that.getURL(series, item);↵ | |
9 | if (u1 != null) {↵ | 9 | if (u1 != null) {↵ | |
10 | if (!u1.equals(u2)) {↵ | 10 | if (!u1.equals(u2)) {↵ | |
11 | return false;↵ | 11 | return false;↵ | |
12 | }↵ | 12 | }↵ | |
13 | }↵ | 13 | }↵ | |
14 | else {↵ | 14 | else {↵ | |
15 | if (u2 != null) {↵ | 15 | if (u2 != null) {↵ | |
16 | return false;↵ | 16 | return false;↵ | |
17 | }↵ | 17 | }↵ | |
18 | }↵ | 18 | }↵ | |
19 | }↵ | 19 | }↵ | |
20 | } | 20 |
| |
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) | 0.6 |
Clones location | Clones are in different classes |
Number of node comparisons | 29 |
Number of mapped statements | 9 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||
---|---|---|---|---|---|---|---|---|---|---|
9 | for (int series = 0; series < listCount; series++) | 9 | for (int series = 0; series < listCount; series++) | |||||||
10 | int urlCount = getURLCount(series); | 10 | int urlCount = getURLCount(series); | |||||||
|
| 11 | if (urlCount != that.getURLCount(series)) | |||||||
|
| 12 | return false; | |||||||
11 | if (urlCount != generator.getURLCount(series)) |
| | |||||||
12 | return false; |
| | |||||||
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 = that.getURL(series, item); | |||||||
15 | String u2 = generator.getURL(series, item); |
| | |||||||
16 | if (u1 != null) | 16 | if (u1 != null) | |||||||
17 | if (!u1.equals(u2)) | 17 | if (!u1.equals(u2)) | |||||||
18 | return false; |
| 18 | return false; | ||||||
else | else | |||||||||
19 | if (u2 != null) | 19 | if (u2 != null) | |||||||
20 | return false; |
| 20 | return false; |
Row | Violation |
---|---|
1 | Unmatched statement if(urlCount != that.getURLCount(series)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched return false; |
3 | Unmatched statement if(urlCount != generator.getURLCount(series)) 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 String u2=that.getURL(series,item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement String u2=generator.getURL(series,item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Clone fragment #1 returns variables series, urlCount, item , while Clone fragment #2 returns variables series, urlCount, item |
8 | Conditional return false; |
9 | Conditional return false; |
10 | Conditional return false; |
11 | Conditional return false; |