File path: /jfreechart-1.0.10/src/org/jfree/chart/HashUtilities.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/HashUtilities.java | |||
Method name: int hashCode(int, BooleanList)
|
Method name: int hashCode(int, PaintList)
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | if (list == null) {↵ | 1 | if (list == null) {↵ | |
2 | return pre;↵ | 2 | return pre;↵ | |
3 | }↵ | 3 | }↵ | |
4 | int result = 127;↵ | 4 | int result = 127;↵ | |
5 | int size = list.size();↵ | 5 | int size = list.size();↵ | |
6 | result = HashUtilities.hashCode(result, size);↵ | 6 | result = HashUtilities.hashCode(result, size);↵ | |
7 | ↵ | 7 | ↵ | |
8 | // for efficiency, we just use the first, last and middle items to↵ | 8 | // for efficiency, we just use the first, last and middle items to↵ | |
9 | // compute a hashCode...↵ | 9 | // compute a hashCode...↵ | |
10 | if (size > 0) {↵ | 10 | if (size > 0) {↵ | |
11 | result = HashUtilities.hashCode(result, list.getBoolean(0));↵ | 11 | result = HashUtilities.hashCode(result, list.getPaint(0));↵ | |
12 | if (size > 1) {↵ | 12 | if (size > 1) {↵ | |
13 | result = HashUtilities.hashCode(result, ↵ | 13 | result = HashUtilities.hashCode(result, ↵ | |
14 | list.getBoolean(size - 1));↵ | 14 | list.getPaint(size - 1));↵ | |
15 | if (size > 2) {↵ | 15 | if (size > 2) {↵ | |
16 | result = HashUtilities.hashCode(result, ↵ | 16 | result = HashUtilities.hashCode(result, ↵ | |
17 | list.getBoolean(size / 2));↵ | 17 | list.getPaint(size / 2));↵ | |
18 | }↵ | 18 | }↵ | |
19 | }↵ | 19 | }↵ | |
20 | }↵ | 20 | }↵ | |
21 | return 37 * pre + result; | 21 |
| |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 32 |
Number of mapped statements | 12 |
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.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (list == null) |
| 1 | if (list == null) | ||||||||||||||||||||
2 | return pre; | 2 | return pre; | |||||||||||||||||||||
3 | int result = 127; | 3 | int result = 127; | |||||||||||||||||||||
4 | int size = list.size(); |
| 4 | int size = list.size(); | ||||||||||||||||||||
5 | result = HashUtilities.hashCode(result, size); | 5 | result = HashUtilities.hashCode(result, size); | |||||||||||||||||||||
6 | if (size > 0) | 6 | if (size > 0) | |||||||||||||||||||||
7 | result = HashUtilities.hashCode(result, list.getBoolean(0)); |
| 7 | result = HashUtilities.hashCode(result, list.getPaint(0)); | ||||||||||||||||||||
8 | if (size > 1) | 8 | if (size > 1) | |||||||||||||||||||||
9 | result = HashUtilities.hashCode(result, list.getBoolean(size - 1)); |
| 9 | result = HashUtilities.hashCode(result, list.getPaint(size - 1)); | ||||||||||||||||||||
10 | if (size > 2) | 10 | if (size > 2) | |||||||||||||||||||||
11 | result = HashUtilities.hashCode(result, list.getBoolean(size / 2)); |
| 11 | result = HashUtilities.hashCode(result, list.getPaint(size / 2)); | ||||||||||||||||||||
12 | return 37 * pre + result; | 12 | return 37 * pre + result; |
Row | Violation |
---|---|
1 | Type java.lang.Boolean of variable list.getBoolean(0) does not match with type java.awt.Paint of variable list.getPaint(0) |
2 | Expression list cannot be unified with expression list , because common superclass org.jfree.util.AbstractObjectList does not declare member(s) public java.lang.Boolean getBoolean(int) , public java.awt.Paint getPaint(int) |
3 | Expression list.getBoolean(size - 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression list.getPaint(size - 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Type java.lang.Boolean of variable list.getBoolean(size - 1) does not match with type java.awt.Paint of variable list.getPaint(size - 1) |
6 | Expression list cannot be unified with expression list , because common superclass org.jfree.util.AbstractObjectList does not declare member(s) public java.lang.Boolean getBoolean(int) , public java.awt.Paint getPaint(int) |
7 | Expression list.getBoolean(size / 2) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression list.getPaint(size / 2) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Type java.lang.Boolean of variable list.getBoolean(size / 2) does not match with type java.awt.Paint of variable list.getPaint(size / 2) |
10 | Expression list cannot be unified with expression list , because common superclass org.jfree.util.AbstractObjectList does not declare member(s) public java.lang.Boolean getBoolean(int) , public java.awt.Paint getPaint(int) |