Table table = (Table) iter.next(); if ( table.isPhysicalTable() ) { Iterator subIter = table.getForeignKeyIterator(); while ( subIter.hasNext() ) { ForeignKey fk = (ForeignKey) subIter.next();
while ( properties.hasNext() ) { Property prop = (Property) properties.next(); if ( prop.getValue() instanceof Component ) { //TODO: remove use of instanceof! Component component = (Component) prop.getValue(); checkPropertyColumnDuplication( distinctColumns, component.getPropertyIterator() ); } else { if ( prop.isUpdateable() || prop.isInsertable() ) { checkColumnDuplication( distinctColumns, prop.getColumnIterator() ); } } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/Configuration.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/PersistentClass.java
Method name: String[] generateDropSchemaScript(Dialect) Method name: void checkPropertyColumnDuplication(Set, Iterator)
Number of AST nodes: 3 Number of AST nodes: 7
1
Table table = (Table) iter
1
while ( properties.hasNext() ) {
2
.next();
2
			Property prop = (Property) properties.next();
3
				if ( table.isPhysicalTable() ) {
3
			if ( 
4
					Iterator subIter = table.getForeignKe
4
prop.getValue() instanceof Component ) { //TODO: remove use of instanceof!
5
				Component component = (Component) prop.getValue();
5
yIterator();
6
				checkPropertyColumnDuplication( distinctColumns, component.getPropertyIterator() );
6
					while ( subIter.hasNext() ) {
7
			
7
						ForeignKey fk = (ForeignKey) subIter.next();
8
}
9
			else {
10
				if ( prop.isUpdateable() || prop.isInsertable() ) {
11
					checkColumnDuplication( distinctColumns, prop.getColumnIterator() );
12
				}
13
			}
14
		}
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 comparisons0