if (x == y) return true;
if (x == null || y == null) return false;
return x.equals(y);
if (x==y) return true;
if (x==null || y==null) return false;
return ( (String[]) x )[0].equals( ( (String[]) y )[0] ) && ( (String[]) x )[1].equals( ( (String[]) y )[1] );
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/sql/hand/MonetaryAmountUserType.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/DoubleStringType.java
|
Method name: boolean equals(Object, Object)
|
|
Method name: boolean equals(Object, Object)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (x == y) return true;↵ | | 1 | if (x==y) return true;↵
|
2 | if (x == null || y == null) return false;↵ | | 2 | if (x==null || y==null) return false;↵
|
3 | return x.equals(y); | | 3 | return ( (String[]) x )[0].equals( ( (String[]) y )[0] ) && ( (String[]) x )[1].equals( ( (String[]) y )[1] );
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 14 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 0.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (x == y) | | 1 | if (x == y) |
2 | | | 2 | |
3 | if (x == null || y == null) | | 3 | if (x == null || y == null) |
4 | | | 4 | |
5 | return x.equals(y); | | 5 | return ((String[])x)[0].equals(((String[])y)[0]) && ((String[])x)[1].equals(((String[])y)[1]); |
Precondition Violations (0)
Row |
Violation |