for ( Iterator iter = customers.iterator(); iter.hasNext(); ) {
Customer c = (Customer) iter.next();
assertTrue( Hibernate.isInitialized( c.getSalesperson() ) );
assertEquals( c.getSalesperson().getName(), "Mark" );
}
for (Iterator it = s.createQuery( "from Parent" ).iterate(); it.hasNext(); ) {
Parent p = (Parent) it.next();
assertEquals( 1, p.getChildren().size() );
s.evict(p);
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/discriminator/DiscriminatorTest.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/reattachment/ProxyReattachmentTest.java
|
Method name: void testDiscriminatorSubclass()
|
|
Method name: void testIterateWithEvictBottomOfLoop()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | for ( Iterator iter = customers.iterator(); iter.hasNext(); ) {↵ | | 1 | for (Iterator it = s.createQuery( "from Parent" ).iterate(); it.hasNext(); ) {
↵
|
2 | Customer c = (Customer) iter.next();↵ | | 2 | Parent p = (Parent) it.next();
↵
|
3 | assertTrue( Hibernate.isInitialized( c.getSalesperson() ) );↵ | | 3 | assertEquals( 1, p.getChildren().size() );
↵
|
4 | assertEquals( c.getSalesperson().getName(), "Mark" );↵ | | 4 | s.evict(p);
↵
|
5 | } | | 5 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 1 |