errorIfClosed(); CustomLoader loader = new CustomLoader( customQuery, getFactory() ); boolean success = false; List results; try { results = loader.list(this, queryParameters); success = true; } finally { afterOperation(success); } temporaryPersistenceContext.clear(); return results;
errorIfClosed(); queryParameters.validateParameters(); NativeSQLQueryPlan plan = getNativeSQLQueryPlan(nativeSQLQuerySpecification); boolean success = false; int result = 0; try { result = plan.performExecuteUpdate(queryParameters, this); success = true; } finally { afterOperation(success); } temporaryPersistenceContext.clear(); return result;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/StatelessSessionImpl.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/StatelessSessionImpl.java
Method name: List listCustomQuery(CustomQuery, QueryParameters) Method name: int executeNativeUpdate(NativeSQLQuerySpecification, QueryParameters)
Number of AST nodes: 9 Number of AST nodes: 10
1
errorIfClosed();
1
errorIfClosed();
2
		CustomLoader loader = new CustomLoader( customQuery, getFactory() 
2
		queryParameters.validateParameters();
3
);
3
		NativeSQLQueryPlan plan = getNativeSQLQueryPlan(nativeSQLQuerySpecification);
4
		boolean success = false;
4
		boolean success = false;
5
		List results;
5
		int result = 0;
6
		try {
6
		try {
7
			results = loader.list(this, queryParameters);
7
			result = plan.performExecuteUpdate(queryParameters, this);
8
			success = true;
8
			success = true;
9
		}
9
		}
10
		finally {
10
 finally {
11
			afterOperation(success);
11
			afterOperation(success);
12
		}
12
		}
13
		temporaryPersistenceContext.clear();
13
		temporaryPersistenceContext.clear();
14
		return results;
14
		return result;
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 comparisons51
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment5
    Time elapsed for statement mapping (ms)21.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    errorIfClosed();
    1
    errorIfClosed();
                                                                                    
    2
    queryParameters.validateParameters();
    2
    CustomLoader loader = new CustomLoader(customQuery, getFactory());
    2
    CustomLoader loader = new CustomLoader(customQuery, getFactory());
    Preondition Violations
    Unmatched statement CustomLoader loader=new CustomLoader(customQuery,getFactory()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                        
                                                                                                                                                                
    3
    NativeSQLQueryPlan plan = getNativeSQLQueryPlan(nativeSQLQuerySpecification);
    3
    boolean success = false;
    4
    boolean success = false;
    4
    List results;
                                    
                                    
    5
    int result = 0;
    5
    try
    6
    try
    6
    results = loader.list(this, queryParameters);
    6
    results = loader.list(this, queryParameters);
    Preondition Violations
    Unmatched statement results=loader.list(this,queryParameters); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement results=loader.list(this,queryParameters); 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
    result = plan.performExecuteUpdate(queryParameters, this);
    Preondition Violations
    Unmatched statement result=plan.performExecuteUpdate(queryParameters,this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement result=plan.performExecuteUpdate(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
    result = plan.performExecuteUpdate(queryParameters, this);
    7
    success = true;
    8
    success = true;
    8
    temporaryPersistenceContext.clear();
    9
    temporaryPersistenceContext.clear();
    9
    return results;
    9
    return results;
    Preondition Violations
    Unmatched return results;
                                        
                                        
    10
    return result;
    Preondition Violations
    Unmatched return result;
    10
    return result;
    Precondition Violations (7)
    Row Violation
    1Unmatched statement CustomLoader loader=new CustomLoader(customQuery,getFactory()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement results=loader.list(this,queryParameters); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement results=loader.list(this,queryParameters); 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
    4Unmatched statement result=plan.performExecuteUpdate(queryParameters,this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement result=plan.performExecuteUpdate(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
    6Unmatched return results;
    7Unmatched return result;