File path: /jfreechart-1.0.10/src/org/jfree/data/KeyedObjects.java | File path: /jfreechart-1.0.10/src/org/jfree/data/category/CategoryToPieDataset.java | |||
Method name: boolean equals(Object)
|
Method name: boolean equals(Object)
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | for (int i = 0; i < count; i++) {↵ | 1 | for (int i = 0; i < count; i++) {↵ | |
2 | Comparable k1 = getKey(i);↵ | 2 | Comparable k1 = getKey(i);↵ | |
3 | Comparable k2 = that.getKey(i);↵ | 3 | Comparable k2 = that.getKey(i);↵ | |
4 | if (!k1.equals(k2)) {↵ | 4 | if (!k1.equals(k2)) {↵ | |
5 | return false;↵ | 5 | return false;↵ | |
6 | }↵ | 6 | }↵ | |
7 | Object o1 = getObject(i);↵ | 7 | Number v1 = getValue(i);↵ | |
8 | Object o2 = that.getObject(i);↵ | 8 | Number v2 = that.getValue(i);↵ | |
9 | if (o1 == null) {↵ | 9 | if (v1 == null) {↵ | |
10 | if (o2 != null) {↵ | 10 | if (v2 != null) {↵ | |
11 | return false;↵ | 11 | return false;↵ | |
12 | }↵ | 12 | }↵ | |
13 | }↵ | 13 | }↵ | |
14 | else {↵ | 14 | else {↵ | |
15 | if (!o1.equals(o2)) {↵ | 15 | if (!v1.equals(v2)) {↵ | |
16 | return false;↵ | 16 | return false;↵ | |
17 | }↵ | 17 | }↵ | |
18 | }↵ | 18 | }↵ | |
19 | } | 19 |
| |
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.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 41 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 4.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9 | for (int i = 0; i < count; i++) | 9 | for (int i = 0; i < count; i++) | ||||||||||||||||||||||
10 | Comparable k1 = getKey(i); | 10 | Comparable k1 = getKey(i); | ||||||||||||||||||||||
11 | Comparable k2 = that.getKey(i); |
| 11 | Comparable k2 = that.getKey(i); | |||||||||||||||||||||
12 | if (!k1.equals(k2)) | 12 | if (!k1.equals(k2)) | ||||||||||||||||||||||
13 | return false; | 13 | return false; | ||||||||||||||||||||||
|
| 14 | Number v1 = getValue(i); | ||||||||||||||||||||||
14 | Object o1 = getObject(i); |
| | ||||||||||||||||||||||
|
| 15 | Number v2 = that.getValue(i); | ||||||||||||||||||||||
15 | Object o2 = that.getObject(i); |
| | ||||||||||||||||||||||
16 | if (o1 == null) |
| 16 | if (v1 == null) | |||||||||||||||||||||
17 | if (o2 != null) |
| 17 | if (v2 != null) | |||||||||||||||||||||
18 | return false; | 18 | return false; | ||||||||||||||||||||||
else | else | ||||||||||||||||||||||||
19 | if (!o1.equals(o2)) |
| 19 | if (!v1.equals(v2)) | |||||||||||||||||||||
20 | return false; | 20 | return false; |
Row | Violation |
---|---|
1 | Type org.jfree.data.KeyedObjects of variable that does not match with type org.jfree.data.general.PieDataset of variable that |
2 | Unmatched statement Number v1=getValue(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement Number v1=getValue(i); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
4 | Unmatched statement Object o1=getObject(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement Object o1=getObject(i); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
6 | Unmatched statement Number v2=that.getValue(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement Object o2=that.getObject(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched statement Object o2=that.getObject(i); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
9 | Type java.lang.Object of variable o1 does not match with type java.lang.Number of variable v1 |
10 | Type java.lang.Object of variable o2 does not match with type java.lang.Number of variable v2 |
11 | Type java.lang.Object of variable o2 does not match with type java.lang.Number of variable v2 |
12 | Type java.lang.Object of variable o1 does not match with type java.lang.Number of variable v1 |
13 | Not all possible execution flows end in a return statement |
14 | The refactoring of the clones is infeasible, because classes org.jfree.data.KeyedObjects and org.jfree.data.category.CategoryToPieDataset do not have a common superclass |