errorIfClosed(); queryParameters.validateParameters(); HQLQueryPlan plan = getHQLQueryPlan( query, false ); boolean success = false; int result = 0; try { result = plan.performExecuteUpdate( queryParameters, this ); success = true; } finally { afterOperation(success); } temporaryPersistenceContext.clear(); return result;
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: int executeUpdate(String, QueryParameters) Method name: int executeNativeUpdate(NativeSQLQuerySpecification, QueryParameters)
Number of AST nodes: 10 Number of AST nodes: 10
1
errorIfClosed();
1
errorIfClosed();
2
		queryParameters.validateParameters();
2
		queryParameters.validateParameters();
3
		HQLQueryPlan plan = getHQLQueryPlan( query, false );
3
		NativeSQLQueryPlan plan = getNativeSQLQueryPlan(nativeSQLQuerySpecification);
4
		boolean success = false;
4
		boolean success = false;
5
		int result = 0;
5
		int result = 0;
6
		try {
6
		try {
7
			result = plan.performExecuteUpdate( queryParameters, this );
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 result;
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 comparisons58
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    errorIfClosed();
    1
    errorIfClosed();
    2
    queryParameters.validateParameters();
    2
    queryParameters.validateParameters();
                                                                                                                                                                
    3
    NativeSQLQueryPlan plan = getNativeSQLQueryPlan(nativeSQLQuerySpecification);
    3
    HQLQueryPlan plan = getHQLQueryPlan(query, false);
                                                                                                        
    4
    boolean success = false;
    4
    boolean success = false;
    5
    int result = 0;
    5
    int result = 0;
    6
    try
    6
    try
    7
    result = plan.performExecuteUpdate(queryParameters, this);
    7
    result = plan.performExecuteUpdate(queryParameters, this);
    7
    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
    7
    result = plan.performExecuteUpdate(queryParameters, this);
    8
    success = true;
    8
    success = true;
    9
    temporaryPersistenceContext.clear();
    9
    temporaryPersistenceContext.clear();
    10
    return result;
    10
    return result;
    Precondition Violations (1)
    Row Violation
    1Type org.hibernate.engine.query.HQLQueryPlan of variable plan does not match with type org.hibernate.engine.query.NativeSQLQueryPlan of variable plan