AST and = create( AND, "{and}" ); AST currentFirstChild = statement.getWhereClause().getFirstChild(); and.setFirstChild( discrimNode ); and.addChild( currentFirstChild ); statement.getWhereClause().setFirstChild( and );
Being b = (Being) iter.next(); assertFalse( Hibernate.isInitialized( b.getLocation() ) ); assertNotNull( b.getLocation().getName() ); assertNotNull( b.getIdentity() ); assertNotNull( b.getSpecies() );
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/util/SyntheticAndFactory.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/unionsubclass/UnionSubclassTest.java
Method name: void addDiscriminatorWhereFragment(RestrictableStatement, Queryable, Map, String) Method name: void testUnionSubclass()
Number of AST nodes: 5 Number of AST nodes: 5
1
AST and = create( AND, "{and}" );
2
			AST currentFirstChild = statement.getWhereClause().getFirstChild(
1
Being b = (Being) iter.next();
3
);
2
			assertFalse( Hibernate.isInitialized( b.getLocation() ) );
4
			and.setFirstChild( discrimNode );
3
			a
5
			and.addChild( currentFirstChild );
6
			statement.getWhereClause().setFirstChild( and
4
ssertNotNull( b.getLocation().getName() );
5
			assertNotNull( b.getIdentity() );
7
 );
6
			assertNotNull( b.getSpecies() );
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 comparisons25