errorIfClosed(); checkTransactionSynchStatus(); queryParameters.validateParameters(); HQLQueryPlan plan = getHQLQueryPlan( query, true ); autoFlushIfRequired( plan.getQuerySpaces() ); dontFlushFromFind++; //stops flush being called multiple times if this method is recursively called try { return plan.performIterate( queryParameters, this ); } finally { dontFlushFromFind--; }
errorIfClosed(); checkTransactionSynchStatus(); HQLQueryPlan plan = getHQLQueryPlan( query, false ); autoFlushIfRequired( plan.getQuerySpaces() ); dontFlushFromFind++; try { return plan.performScroll( queryParameters, this ); } finally { dontFlushFromFind--; }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/SessionImpl.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/SessionImpl.java
Method name: Iterator iterate(String, QueryParameters) Method name: ScrollableResults scroll(String, QueryParameters)
Number of AST nodes: 8 Number of AST nodes: 7
1
errorIfClosed();
1
errorIfClosed();
2
		checkTransactionSynchStatus();
2
		checkTransactionSynchStatus();
3
		queryParameters.validateParameters();
3
		
4
		HQLQueryPlan plan = getHQLQueryPlan( query, true );
4
HQLQueryPlan plan = getHQLQueryPlan( query, false );
5
		autoFlushIfRequired( plan.getQuerySpaces() );
5
		autoFlushIfRequired( plan.getQuerySpaces() );
6
		dontFlushFromFind++; //stops flush being called multiple times if this method is recursively called
6
		dontFlushFromFind++;
7
		try {
7
		try {
8
			return plan.performIterate( queryParameters, this );
8
			return plan.performScroll( queryParameters, this );
9
		}
9
		}
10
		finally {
10
		finally {
11
			dontFlushFromFind--;
11
			dontFlushFromFind--;
12
		}
12
		}
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.1
Clones locationClones are declared in the same class
Number of node comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    errorIfClosed();
    1
    errorIfClosed();
    2
    checkTransactionSynchStatus();
    2
    checkTransactionSynchStatus();
    3
    queryParameters.validateParameters();
                                                                                    
    4
    HQLQueryPlan plan = getHQLQueryPlan(query, true);
    4
    HQLQueryPlan plan = getHQLQueryPlan(query, true);
    3
    HQLQueryPlan plan = getHQLQueryPlan(query, false);
    Differences
    Expression1Expression2Difference
    truefalseLITERAL_VALUE_MISMATCH
    3
    HQLQueryPlan plan = getHQLQueryPlan(query, false);
    5
    autoFlushIfRequired(plan.getQuerySpaces());
    4
    autoFlushIfRequired(plan.getQuerySpaces());
    6
    dontFlushFromFind++;
    5
    dontFlushFromFind++;
    7
    try
    6
    try
                                                                                                          
    7
    return plan.performScroll(queryParameters, this);
    Preondition Violations
    Unmatched statement return plan.performScroll(queryParameters,this); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    7
    return plan.performScroll(queryParameters, this);
    8
    return plan.performIterate(queryParameters, this);
    8
    return plan.performIterate(queryParameters, this);
    Preondition Violations
    Unmatched statement return plan.performIterate(queryParameters,this); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                            
    Precondition Violations (2)
    Row Violation
    1Unmatched statement return plan.performScroll(queryParameters,this); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    2Unmatched statement return plan.performIterate(queryParameters,this); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted