if ( collectionIsInitialized(collection) ) { // handles arrays and newly instantiated collections return collectionType.getElementsIterator(collection, session); } else { // does not handle arrays (thats ok, cos they can't be lazy) // or newly instantiated collections, so we can do the cast return ( (PersistentCollection) collection ).queuedAdditionIterator(); }
Properties clone = ( Properties ) props.clone(); if ( clone.get( key ) != null ) { clone.setProperty( key, "****" ); } return clone;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/CascadingAction.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/PropertiesHelper.java
Method name: Iterator getLoadedElementsIterator(SessionImplementor, CollectionType, Object) Method name: Properties maskOut(Properties, String)
Number of AST nodes: 3 Number of AST nodes: 4
1
if ( collectionIsInitialized(collection) ) {
2
			// handles arrays and newly instantiated collections
3
			return collectionType.getElementsIterator(collection, session);
4
		}
5
		else {
6
			// does not handle arrays (thats ok, cos they can't be lazy)
7
			// or newly instantiated collections, so we can do the cast
1
Properties clone = ( Properties ) props.clone();
2
		if ( clone.get( key ) != null ) {
3
			clone.setProperty( key, "****" );
4
		}
8
			return ( (PersistentCollection) collection ).queuedAdditionIterator();
5
		return 
9
		}
6
clone;
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 in different classes
Number of node comparisons1