public class CGLIBProxyFactory implements ProxyFactory { protected static final Class[] NO_CLASSES = new Class[0]; private Class persistentClass; private String entityName; private Class[] interfaces; private Method getIdentifierMethod; private Method setIdentifierMethod; private AbstractComponentType componentIdType; private Class factory; public void postInstantiate( final String entityName, final Class persistentClass, final Set interfaces, final Method getIdentifierMethod, final Method setIdentifierMethod, AbstractComponentType componentIdType) throws HibernateException { this.entityName = entityName; this.persistentClass = persistentClass; this.interfaces = (Class[]) interfaces.toArray(NO_CLASSES); this.getIdentifierMethod = getIdentifierMethod; this.setIdentifierMethod = setIdentifierMethod; this.componentIdType = componentIdType; factory = CGLIBLazyInitializer.getProxyFactory(persistentClass, this.interfaces); } public HibernateProxy getProxy(Serializable id, SessionImplementor session) throws HibernateException { return CGLIBLazyInitializer.getProxy( factory, entityName, persistentClass, interfaces, getIdentifierMethod, setIdentifierMethod, componentIdType, id, sessio
public class JavassistProxyFactory implements ProxyFactory, Serializable { protected static final Class[] NO_CLASSES = new Class[0]; private Class persistentClass; private String entityName; private Class[] interfaces; private Method getIdentifierMethod; private Method setIdentifierMethod; private AbstractComponentType componentIdType; private Class factory; public void postInstantiate( final String entityName, final Class persistentClass, final Set interfaces, final Method getIdentifierMethod, final Method setIdentifierMethod, AbstractComponentType componentIdType) throws HibernateException { this.entityName = entityName; this.persistentClass = persistentClass; this.interfaces = (Class[]) interfaces.toArray(NO_CLASSES); this.getIdentifierMethod = getIdentifierMethod; this.setIdentifierMethod = setIdentifierMethod; this.componentIdType = componentIdType; factory = JavassistLazyInitializer.getProxyFactory( persistentClass, this.interfaces ); } public HibernateProxy getProxy( Serializable id, SessionImplementor session) throws HibernateException { return JavassistLazyInitializer.getProxy( factory, entityName, persistentClass, interfaces, getIdentifierMethod, setIdentifierMethod, componentIdType, id, sessio
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/proxy/pojo/cglib/CGLIBProxyFactory.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistProxyFactory.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class CGLIBProxyFactory implements ProxyFactory {
1
public class JavassistProxyFactory implements ProxyFactory, Serializable {
2
	protected static final Class[] NO_CLASSES = new Class[0];
2
	protected static final Class[] NO_CLASSES = new Class[0];
3
	private Class persistentClass;
3
	private Class persistentClass;
4
	private String entityName;
4
	private String entityName;
5
	private Class[] interfaces;
5
	private Class[] interfaces;
6
	private Method getIdentifierMethod;
6
	private Method getIdentifierMethod;
7
	private Method setIdentifierMethod;
7
	private Method setIdentifierMethod;
8
	private AbstractComponentType componentIdType;
8
	private AbstractComponentType componentIdType;
9
	private Class factory;
9
	private Class factory;
10
	public void postInstantiate(
10
	public void postInstantiate(
11
		final String entityName,
11
			final String entityName,
12
		final Class persistentClass,
12
			final Class persistentClass,
13
		final Set interfaces,
13
	        final Set interfaces,
14
		final Method getIdentifierMethod,
14
			final Method getIdentifierMethod,
15
		final Method setIdentifierMethod,
15
	        final Method setIdentifierMethod,
16
		AbstractComponentType componentIdType)
16
			AbstractComponentType componentIdType)
17
	throws HibernateException {
17
 throws HibernateException {
18
		this.entityName = entityName;
18
		this.entityName = entityName;
19
		this.persistentClass = persistentClass;
19
		this.persistentClass = persistentClass;
20
		this.interfaces = (Class[]) interfaces.toArray(NO_CLASSES);
20
		this.interfaces = (Class[]) interfaces.toArray(NO_CLASSES);
21
		this.getIdentifierMethod = getIdentifierMethod;
21
		this.getIdentifierMethod = getIdentifierMethod;
22
		this.setIdentifierMethod = setIdentifierMethod;
22
		this.setIdentifierMethod = setIdentifierMethod;
23
		this.componentIdType = componentIdType;
23
		this.componentIdType = componentIdType;
24
		factory = CGLIBLazyInitializer.getProxyFactory(persistentClass, this.interfaces);
24
		factory = JavassistLazyInitializer.getProxyFactory( persistentClass, this.interfaces );
25
	}
25
	}
26
	public HibernateProxy getProxy(
26
	public HibernateProxy getProxy(
27
Serializable id,
27
			Serializable id,
28
 SessionImplementor session)
28
	        SessionImplementor session)
29
		throws HibernateException {
29
 throws HibernateException {
30
		return CGLIBLazyInitializer.getProxy(
30
		return JavassistLazyInitializer.getProxy(
31
				factory, 
31
				factory,
32
				entityName, 
32
		        entityName,
33
				persistentClass, 
33
				persistentClass,
34
				interfaces, 
34
		        interfaces,
35
				getIdentifierMethod, 
35
		        getIdentifierMethod,
36
				setIdentifierMethod,
36
				setIdentifierMethod,
37
				componentIdType,
37
		        componentIdType,
38
				id, 
38
		        id,
39
				sessio
39
		        sessio
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 location
Number of node comparisons0