while ( subIter.hasNext() ) { ForeignKey fk = (ForeignKey) subIter.next(); if ( fk.isPhysicalConstraint() ) { script.add( fk.sqlCreateString( dialect, mapping, defaultCatalog, defaultSchema ) ); } }
while ( iter.hasNext() ) { Table table = (Table) iter.next(); if ( table.isPhysicalTable() ) { /*Iterator subIter = table.getIndexIterator(); while ( subIter.hasNext() ) { Index index = (Index) subIter.next(); if ( !index.isForeignKey() || !dialect.hasImplicitIndexForForeignKey() ) { script.add( index.sqlDropString(dialect) ); } }*/ script.add( table.sqlDropString( dialect, defaultCatalog, defaultSchema ) ); } }
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/cfg/Configuration.java
Method name: String[] generateSchemaCreationScript(Dialect) Method name: String[] generateDropSchemaScript(Dialect)
Number of AST nodes: 4 Number of AST nodes: 4
1
while ( subIter.hasNext() ) {
1
while ( iter.hasNext() ) {
2
						ForeignKey fk = (ForeignKey
2
			Table table = (Table) iter.next();
3
			if ( table.isPhysicalTable() ) {
4
				/*Iterator subIter = table.getIndexIterator();
5
				while ( subIter.hasNext() ) {
3
) subIter.next();
6
					Index index = (Index) subIter.next();
4
						if ( fk.isPhysicalConstraint(
7
					if ( !index.isForeignKey() || !dialect.hasImplicitIndexForForeignKey() ) {
5
) ) {
8
						script.add( index.sqlDropString(dialect) );
6
			
9
					}
10
				}*/
7
				script.add(
11
				script.add(
8
									fk.sqlCreateString(
12
						table.sqlDropString(
9
											dialect, mapping,
13
								dialect,
10
			
11
								defaultCatalog,
14
								defaultCatalog,
12
											defaultSchema
15
								defaultSchema
13
										)
16
							)
14
								);
17
					);
15
		
16
				}
18
			}
17
			
18
		}
19
		}
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.1
Clones locationClones are declared in the same class
Number of node comparisons1