File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/ArrayHelper.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/ArrayHelper.java | |||
Method name: boolean isEquals(byte[], byte[])
|
Method name: boolean isEquals(Object[], Object[])
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | if (b1 == b2) return true;↵ | 1 | if (o1 == o2) return true;↵ | |
2 | if (b1 == null || b2 == null) return false;↵ | 2 | if (o1 == null || o2 == null) return false;↵ | |
3 | int length = b1.length;↵ | 3 | int length = o1.length;↵ | |
4 | if (length != b2.length) return false;↵ | 4 | if (length != o2.length) return false;↵ | |
5 | for (int index = 0 ; index < length ; index++) {↵ | 5 | for (int index = 0 ; index < length ; index++) {↵ | |
6 | if ( ! ( b1[index] == b2[index] ) ) return false;↵ | 6 | if ( ! o1[index].equals( o2[index] ) ) return false;↵ | |
7 | }↵ | 7 | }↵ | |
8 | return true; | 8 |
| |
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.9 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 24 |
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) | 1.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | if (b1 == null || b2 == null) |
| 3 | if (o1 == null || o2 == null) | |||||||||||||||||||||
4 | return false; |
| 4 | return false; | |||||||||||||||||||||
5 | int length = b1.length; |
| 5 | int length = o1.length; | |||||||||||||||||||||
6 | if (length != b2.length) |
| 6 | if (length != o2.length) | |||||||||||||||||||||
7 | return false; |
| 7 | return false; | |||||||||||||||||||||
8 | for (int index = 0; index < length; index++) | 8 | for (int index = 0; index < length; index++) | ||||||||||||||||||||||
9 | if (!(b1[index] == b2[index])) |
| 9 | if (!o1[index].equals(o2[index])) | |||||||||||||||||||||
10 | return false; |
| 10 | return false; |
Row | Violation |
---|---|
1 | Type byte[] of variable b1 does not match with type java.lang.Object[] of variable o1 |
2 | Type byte[] of variable b2 does not match with type java.lang.Object[] of variable o2 |
3 | Type byte[] of variable b1 does not match with type java.lang.Object[] of variable o1 |
4 | Type byte[] of variable b2 does not match with type java.lang.Object[] of variable o2 |
5 | Expression (b1[index] == b2[index]) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression o1[index].equals(o2[index]) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Conditional return false; |
8 | Conditional return false; |
9 | Conditional return false; |
10 | Conditional return false; |
11 | Conditional return false; |
12 | Conditional return false; |