if ( queryableCollection == null ) { return false; } else { return !queryableCollection.getElementType().isEntityType(); }
if ( maxPosition == null ) { // we have not yet hit the last result... return false; } else { return currentPosition == maxPosition.intValue(); }
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/FromElementType.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/FetchingScrollableResultsImpl.java
Method name: boolean isCollectionOfValuesOrComponents() Method name: boolean isLast()
Number of AST nodes: 3 Number of AST nodes: 3
1
if ( queryableCollection == null ) {
1
if ( maxPosition == null ) {
2
			
2
			// we have not yet hit the last result...
3
	return false;
3
			return false;
4
			}
4
		}
5
			else {
5
		else {
6
				return !queryableCollection.getElementType().isEntityType();
6
			return currentPosition == maxPosition.intValue();
7
			}
7
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (queryableCollection == null)
    2
    if (queryableCollection == null)
    1
    if (maxPosition == null)
    Differences
    Expression1Expression2Difference
    queryableCollectionmaxPositionVARIABLE_NAME_MISMATCH
    org.hibernate.persister.collection.QueryableCollectionjava.lang.IntegerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.persister.collection.QueryableCollection of variable queryableCollection does not match with type java.lang.Integer of variable maxPosition
    • Make classes org.hibernate.persister.collection.QueryableCollection and java.lang.Integer extend a common superclass
    1
    if (maxPosition == null)
    3
    return false;
    2
    return false;
    else
    else
    4
    return !queryableCollection.getElementType().isEntityType();
    4
    return !queryableCollection.getElementType().isEntityType();
    3
    return currentPosition == maxPosition.intValue();
    Differences
    Expression1Expression2Difference
    !queryableCollection.getElementType().isEntityType()currentPosition == maxPosition.intValue()TYPE_COMPATIBLE_REPLACEMENT
    3
    return currentPosition == maxPosition.intValue();
    Precondition Violations (1)
    Row Violation
    1Type org.hibernate.persister.collection.QueryableCollection of variable queryableCollection does not match with type java.lang.Integer of variable maxPosition