if ( isPropertyIncluded(value, subpath, subtype) ) { if ( subtype.isComponentType() ) { addComponentTypedValues(subpath, value, (AbstractComponentType) subtype, list, criteria, criteriaQuery); } else { addPropertyTypedValue(value, subtype, list); } }
if ( wrapper.setCurrentSession(session) ) { //a "detached" collection! if ( !isOwnerUnchanged( wrapper, persister, collectionKey ) ) { // if the collection belonged to a different entity, // clean up the existing state of the collection removeCollection( persister, collectionKey, session ); } reattachCollection(wrapper, type); } else { // a collection loaded in the current session // can not possibly be the collection belonging // to the entity passed to update() removeCollection(persister, collectionKey, session); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/criterion/Example.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/OnUpdateVisitor.java
Method name: void addComponentTypedValues(String, Object, AbstractComponentType, List, Criteria, CriteriaQuery) Method name: Object processCollection(Object, CollectionType)
Number of AST nodes: 4 Number of AST nodes: 5
1
if ( isPropertyIncluded(value, subpath, subtype) ) {
1
if ( 
2
					if ( subtype.isComponentType() ) {
3
						addComponentTypedValues(subpath, value, (AbstractComponentType) subtype, list, criteria, criteriaQuery);
4
					}
5
					else {
6
						addPropertyTypedValue(value, subtype, list);
7
					}
8
	
2
wrapper.setCurrentSession(session) ) {
3
				//a "detached" collection!
4
				if ( !isOwnerUnchanged( wrapper, persister, collectionKey ) ) {
5
					// if the collection belonged to a different entity,
6
					// clean up the existing state of the collection
7
					removeCollection( persister, collectionKey, session );
8
				}
9
				reattachCollection(wrapper, type);
10
			}
11
			else {
12
				// a collection loaded in the current session
13
				// can not possibly be the collection belonging
14
				// to the entity passed to update()
15
				removeCollection(persister, collectionKey, session);
9
			}
16
			}
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.2
Clones locationClones are in different classes
Number of node comparisons1