try { doQueryAndInitializeNonLazyCollections( session, new QueryParameters( new Type[]{type}, ids, ids ), true ); } catch ( SQLException sqle ) { throw JDBCExceptionHelper.convert( factory.getSQLExceptionConverter(), sqle, "could not initialize a collection: " + MessageHelper.collectionInfoString( getCollectionPersisters()[0], id, getFactory() ), getSQLString() ); }
try { doQueryAndInitializeNonLazyCollections( session, new QueryParameters( parameterTypes, parameterValues, namedParameters, ids ), true ); } catch ( SQLException sqle ) { throw JDBCExceptionHelper.convert( factory.getSQLExceptionConverter(), sqle, "could not load collection by subselect: " + MessageHelper.collectionInfoString( getCollectionPersisters()[0], ids, getFactory() ), getSQLString() ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/loader/Loader.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/loader/Loader.java
Method name: void loadCollection(SessionImplementor, Serializable, Type) Method name: void loadCollectionSubselect(SessionImplementor, Serializable[], Object[], Type[], Map, Type)
Number of AST nodes: 2 Number of AST nodes: 2
1
try {
1
try {
2
			doQueryAndInitializeNonLazyCollections( 
2
			doQueryAndInitializeNonLazyCollections( 
3
					session,
3
session,
4
					new QueryParameters( new Type[]{type}, ids, ids ),
4
					new QueryParameters( parameterTypes, parameterValues, namedParameters, ids ),
5
					true 
5
					true 
6
				);
6
				);
7
		}
7
		}
8
		catch ( SQLException sqle ) {
8
		catch ( SQLException sqle ) {
9
			throw JDBCExceptionHelper.convert(
9
			throw JDBCExceptionHelper.convert(
10
					factory.getSQLExceptionConverter(),
10
			        factory.getSQLExceptionConverter(),
11
					sqle,
11
			        sqle,
12
					"could not initialize a collection: " + 
12
			        "could not load collection by subselect: " + 
13
					MessageHelper.collectionInfoString( getCollectionPersisters()[0], id, getFactory() ),
13
			        MessageHelper.collectionInfoString( getCollectionPersisters()[0], ids, getFactory() ),
14
					getSQLString()
14
			        getSQLString()
15
				);
15
				);
16
		}
16
		}
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.8
Clones locationClones are declared in the same class
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    try
    4
    try
    3
    try
    Differences
    Expression1Expression2Difference
    "could not initialize a collection: ""could not load collection by subselect: "LITERAL_VALUE_MISMATCH
    ididsVARIABLE_NAME_MISMATCH
    java.io.Serializablejava.io.Serializable[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.io.Serializable of variable id does not match with type java.io.Serializable[] of variable ids
    • Make classes java.io.Serializable and java.io.Serializable[] extend a common superclass
    3
    try
    5
    doQueryAndInitializeNonLazyCollections(session, new QueryParameters(new Type[] {type}, ids, ids), true);
    5
    doQueryAndInitializeNonLazyCollections(session, new QueryParameters(new Type[] {type}, ids, ids), true);
    4
    doQueryAndInitializeNonLazyCollections(session, new QueryParameters(parameterTypes, parameterValues, namedParameters, ids), true);
    Differences
    Expression1Expression2Difference
    new QueryParameters(new Type[]{type},ids,ids)new QueryParameters(parameterTypes,parameterValues,namedParameters,ids)ARGUMENT_NUMBER_MISMATCH
    4
    doQueryAndInitializeNonLazyCollections(session, new QueryParameters(parameterTypes, parameterValues, namedParameters, ids), true);
    Precondition Violations (1)
    Row Violation
    1Type java.io.Serializable of variable id does not match with type java.io.Serializable[] of variable ids