if ( needsLimit ) { log.warn( "firstResult/maxResults specified on polymorphic query; applying in memory!" ); RowSelection selection = new RowSelection(); selection.setFetchSize( queryParameters.getRowSelection().getFetchSize() ); selection.setTimeout( queryParameters.getRowSelection().getTimeout() ); queryParametersToUse = queryParameters.createCopyUsing( selection ); } else { queryParametersToUse = queryParameters; }
if ( hasLimit && containsCollectionFetches() ) { log.warn( "firstResult/maxResults specified with collection fetch; applying in memory!" ); RowSelection selection = new RowSelection(); selection.setFetchSize( queryParameters.getRowSelection().getFetchSize() ); selection.setTimeout( queryParameters.getRowSelection().getTimeout() ); queryParametersToUse = queryParameters.createCopyUsing( selection ); } else { queryParametersToUse = queryParameters; }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/query/HQLQueryPlan.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/QueryTranslatorImpl.java
Method name: List performList(QueryParameters, SessionImplementor) Method name: List list(SessionImplementor, QueryParameters)
Number of AST nodes: 7 Number of AST nodes: 7
1
if ( needsLimit ) {
1
if ( hasLimit && containsCollectionFetches() ) {
2
			log.warn( "firstResult/maxResults specified on polymorphic query; applying in memory!" );
2
			log.warn( "firstResult/maxResults specified with collection fetch; applying in memory!" );
3
			RowSelection selection = new RowSelection();
3
			RowSelection selection = new RowSelection();
4
			selection.setFetchSize( queryParameters.getRowSelection().getFetchSize() );
4
			selection.setFetchSize( queryParameters.getRowSelection().getFetchSize() );
5
			selection.setTimeout( queryParameters.getRowSelection().getTimeout() );
5
			selection.setTimeout( queryParameters.getRowSelection().getTimeout() );
6
			queryParametersToUse = queryParameters.createCopyUsing( selection );
6
			queryParametersToUse = queryParameters.createCopyUsing( selection );
7
		}
7
		}
8
		else {
8
		else {
9
			queryParametersToUse = queryParameters;
9
			queryParametersToUse = queryParameters;
10
		}
10
		}
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes
Number of node comparisons1