TransactionProtectionWrapper wrapper = new TransactionProtectionWrapper( session ); Session wrapped = ( Session ) Proxy.newProxyInstance( Session.class.getClassLoader(), SESS_PROXY_INTERFACES, wrapper ); // yick! need this for proper serialization/deserialization handling... wrapper.setWrapped( wrapped ); return wrapped;
QueryTranslatorFactory ast = new ASTQueryTranslatorFactory(); QueryTranslator queryTranslator = ast.createQueryTranslator( hql, hql, Collections.EMPTY_MAP, sfi() ); queryTranslator.compile( Collections.EMPTY_MAP, true ); return queryTranslator.getSQLString();
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/context/ThreadLocalSessionContext.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/hql/EJBQLTest.java
Method name: Session wrap(Session) Method name: String toSql(String)
Number of AST nodes: 4 Number of AST nodes: 4
1
TransactionProtectionWrapper wrapper = new TransactionProtectionWrapper( session );
2
		Session wrapped = ( Session ) Proxy.newProxyInstance(
3
				Session.class.getClassLoader(),
4
		        SESS_PROXY_INTERFACES,
5
		        wrapper
6
			);
7
		// yick!  need this for proper serialization/deserialization handling...
8
		wrapper.setWrapped( wrapped );
9
		return wrapped
1
QueryTranslatorFactory ast = new ASTQueryTranslatorFactory();
2
		QueryTranslator queryTranslator = ast.createQueryTranslator( hql, hql, Collections.EMPTY_MAP, sfi() );
3
		queryTranslator.compile( Collections.EMPTY_MAP, true );
10
;
4
		return queryTranslator.getSQLString();
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.0
Clones locationClones are in different classes
Number of node comparisons16