Type type = null;
if ( operand instanceof SqlNode ) {
type = ( ( SqlNode ) operand ).getDataType();
}
if ( type == null && operand instanceof ExpectedTypeAwareNode ) {
type = ( ( ExpectedTypeAwareNode ) operand ).getExpectedType();
}
return type;
Type type = null;
if ( operand instanceof SqlNode ) {
type = ( ( SqlNode ) operand ).getDataType();
}
if ( type == null && operand instanceof ExpectedTypeAwareNode ) {
type = ( ( ExpectedTypeAwareNode ) operand ).getExpectedType();
}
return type;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/tree/AbstractNullnessCheckNode.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/tree/BinaryLogicOperatorNode.java
|
Method name: Type extractDataType(Node)
|
|
Method name: Type extractDataType(Node)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | Type type = null;↵ | | 1 | Type type = null;↵
|
2 | if ( operand instanceof SqlNode ) {↵ | | 2 | if ( operand instanceof SqlNode ) {↵
|
3 | type = ( ( SqlNode ) operand ).getDataType();↵ | | 3 | type = ( ( SqlNode ) operand ).getDataType();↵
|
4 | }↵ | | 4 | }↵
|
5 | if ( type == null && operand instanceof ExpectedTypeAwareNode ) {↵ | | 5 | if ( type == null && operand instanceof ExpectedTypeAwareNode ) {↵
|
6 | type = ( ( ExpectedTypeAwareNode ) operand ).getExpectedType();↵ | | 6 | type = ( ( ExpectedTypeAwareNode ) operand ).getExpectedType();↵
|
7 | }↵ | | 7 | }↵
|
8 | return type; | | 8 | return type;
|
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 17 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | Type type = null; | | 1 | Type type = null; |
2 | if (operand instanceof SqlNode) | | 2 | if (operand instanceof SqlNode) |
3 | type = ((SqlNode)operand).getDataType(); | | 3 | type = ((SqlNode)operand).getDataType(); |
4 | if (type == null && operand instanceof ExpectedTypeAwareNode) | | 4 | if (type == null && operand instanceof ExpectedTypeAwareNode) |
5 | type = ((ExpectedTypeAwareNode)operand).getExpectedType(); | | 5 | type = ((ExpectedTypeAwareNode)operand).getExpectedType(); |
6 | return type; | | 6 | return type; |
Precondition Violations (0)
Row |
Violation |