errorIfClosed(); checkTransactionSynchStatus(); queryParameters.validateParameters(); HQLQueryPlan plan = getHQLQueryPlan( query, false ); autoFlushIfRequired( plan.getQuerySpaces() ); boolean success = false; int result = 0; try { result = plan.performExecuteUpdate( queryParameters, this ); success = true; } finally { afterOperation(success); } return result;
errorIfClosed(); checkTransactionSynchStatus(); queryParameters.validateParameters(); NativeSQLQueryPlan plan = getNativeSQLQueryPlan(nativeQuerySpecification); autoFlushIfRequired( plan.getCustomQuery().getQuerySpaces() ); boolean success = false; int result = 0; try { result = plan.performExecuteUpdate(queryParameters, this); success = true; } finally { afterOperation(success); } 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/SessionImpl.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/SessionImpl.java
Method name: int executeUpdate(String, QueryParameters) Method name: int executeNativeUpdate(NativeSQLQuerySpecification, QueryParameters)
Number of AST nodes: 11 Number of AST nodes: 11
1
errorIfClosed();
1
errorIfClosed();
2
		checkTransactionSynchStatus();
2
        checkTransactionSynchStatus();
3
		queryParameters.validateParameters();
3
        queryParameters.validateParameters();
4
		HQLQueryPlan plan = getHQLQueryPlan( query, false );
4
        NativeSQLQueryPlan plan = getNativeSQLQueryPlan(
5
		
5
nativeQuerySpecification);
6
        
6
autoFlushIfRequired( plan.getQuerySpaces() );
7
        autoFlushIfRequired( plan.get
7
		
8
CustomQuery().getQuerySpaces() );
9
        
8
boolean success = false;
10
        boolean success = false;
9
		int result = 0;
11
        int result = 0;
10
		try {
11
			
12
        try {
12
result = plan.performExecuteUpdate( queryParameters, this );
13
            result = plan.performExecuteUpdate(queryParameters, this);
13
			success = true;
14
            success = true;
14
		}
15
		finally {
16
			
15
        } finally {
17
afterOperation(success);
16
            afterOperation(success);
18
		}
19
		
17
        }
20
return result;
18
        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 comparisons73
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)26.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    errorIfClosed();
    1
    errorIfClosed();
    2
    checkTransactionSynchStatus();
    2
    checkTransactionSynchStatus();
    3
    queryParameters.validateParameters();
    3
    queryParameters.validateParameters();
                                                                                                                                                          
    4
    NativeSQLQueryPlan plan = getNativeSQLQueryPlan(nativeQuerySpecification);
    4
    HQLQueryPlan plan = getHQLQueryPlan(query, false);
                                                                                                        
                                                                                                                                  
    5
    autoFlushIfRequired(plan.getCustomQuery().getQuerySpaces());
    Preondition Violations
    Unmatched statement autoFlushIfRequired(plan.getCustomQuery().getQuerySpaces()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5
    autoFlushIfRequired(plan.getCustomQuery().getQuerySpaces());
    5
    autoFlushIfRequired(plan.getQuerySpaces());
    5
    autoFlushIfRequired(plan.getQuerySpaces());
    Preondition Violations
    Unmatched statement autoFlushIfRequired(plan.getQuerySpaces()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                
    6
    boolean success = false;
    6
    boolean success = false;
    7
    int result = 0;
    7
    int result = 0;
    8
    try
    8
    try
    9
    result = plan.performExecuteUpdate(queryParameters, this);
    9
    result = plan.performExecuteUpdate(queryParameters, this);
    9
    result = plan.performExecuteUpdate(queryParameters, this);
    Differences
    Expression1Expression2Difference
    org.hibernate.engine.query.HQLQueryPlanorg.hibernate.engine.query.NativeSQLQueryPlanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.engine.query.HQLQueryPlan of variable plan does not match with type org.hibernate.engine.query.NativeSQLQueryPlan of variable plan
    • Make classes org.hibernate.engine.query.HQLQueryPlan and org.hibernate.engine.query.NativeSQLQueryPlan extend a common superclass
    9
    result = plan.performExecuteUpdate(queryParameters, this);
    10
    success = true;
    10
    success = true;
    11
    return result;
    11
    return result;
    Precondition Violations (3)
    Row Violation
    1Unmatched statement autoFlushIfRequired(plan.getCustomQuery().getQuerySpaces()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement autoFlushIfRequired(plan.getQuerySpaces()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Type org.hibernate.engine.query.HQLQueryPlan of variable plan does not match with type org.hibernate.engine.query.NativeSQLQueryPlan of variable plan