log.trace( "creating new proxy for entity" ); // return new uninitialized proxy Object proxy = persister.createProxy( event.getEntityId(), event.getSession() ); persistenceContext.getBatchFetchQueue().addBatchLoadableEntityKey(keyToLoad); persistenceContext.addProxy(keyToLoad, proxy); return proxy;
Human h = (Human) list.get(i); assertTrue( Hibernate.isInitialized( h.getLocation() ) ); assertTrue( Hibernate.isInitialized( h.getLocation().getBeings() ) ); s.delete(h);
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/DefaultLoadEventListener.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/unionsubclass/UnionSubclassTest.java
Method name: Object createProxyIfNecessary(LoadEvent, EntityPersister, EntityKey, LoadEventListener.LoadType, PersistenceContext) Method name: void testUnionSubclassFetchMode()
Number of AST nodes: 5 Number of AST nodes: 4
1
log.trace( "creating new proxy for entity" );
2
			// return new uninitialized proxy
3
			Object proxy = persister.createProxy( event.getEntityId(), event.getSession() );
4
			persistenceContext.getBatchFetchQueue().addBatchLoadableEntityKey(keyToLoad);
5
			persistenceContext.addProxy(keyToLoad, proxy);
6
			return proxy
1
Human h = (Human) list.get(i);
2
			assertTrue( Hibernate.isInitialized( h.getLocation() ) );
3
			assertTrue( Hibernate.isInitialized( h.getLocation().getBeings() ) );
7
;
4
			s.delete(h);
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.0
Clones locationClones are in different classes
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    10
    log.trace("creating new proxy for entity");
                                                                                                  
    11
    Object proxy = persister.createProxy(event.getEntityId(), event.getSession());
                                                                                                                                                                  
    12
    persistenceContext.getBatchFetchQueue().addBatchLoadableEntityKey(keyToLoad);
                                                                                                                                                                      
                                                                  
    19
    Human h = (Human)list.get(i);
    Preondition Violations
    Unmatched statement Human h=(Human)list.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    19
    Human h = (Human)list.get(i);
    13
    persistenceContext.addProxy(keyToLoad, proxy);
    13
    persistenceContext.addProxy(keyToLoad, proxy);
    20
    assertTrue(Hibernate.isInitialized(h.getLocation()));
    Differences
    Expression1Expression2Difference
    addProxyassertTrueMETHOD_INVOCATION_NAME_MISMATCH
    persistenceContext.addProxy(keyToLoad,proxy)assertTrue(Hibernate.isInitialized(h.getLocation()))ARGUMENT_NUMBER_MISMATCH
    persistenceContextMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression persistenceContext.addProxy(keyToLoad,proxy) is a void method call, and thus it cannot be parameterized
    Expression assertTrue(Hibernate.isInitialized(h.getLocation())) is a void method call, and thus it cannot be parameterized
    Expression persistenceContext.addProxy(keyToLoad,proxy) is a void method call, and thus it cannot be parameterized
    Expression assertTrue(Hibernate.isInitialized(h.getLocation())) is a void method call, and thus it cannot be parameterized
    20
    assertTrue(Hibernate.isInitialized(h.getLocation()));
    14
    return proxy;
    14
    return proxy;
    Preondition Violations
    Unmatched return proxy;
                                      
                                                                                                                                              
    21
    assertTrue(Hibernate.isInitialized(h.getLocation().getBeings()));
                                    
    22
    s.delete(h);
    Precondition Violations (6)
    Row Violation
    1Unmatched statement Human h=(Human)list.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression persistenceContext.addProxy(keyToLoad,proxy) is a void method call, and thus it cannot be parameterized
    3Expression assertTrue(Hibernate.isInitialized(h.getLocation())) is a void method call, and thus it cannot be parameterized
    4Expression persistenceContext.addProxy(keyToLoad,proxy) is a void method call, and thus it cannot be parameterized
    5Expression assertTrue(Hibernate.isInitialized(h.getLocation())) is a void method call, and thus it cannot be parameterized
    6Unmatched return proxy;