if ( !collection.wasInitialized() && ce.getLoadedPersister() == collectionPersister ) { if ( checkForEnd && i == end ) { return keys; //the first key found after the given key } //if ( end == -1 && count > batchSize*10 ) return keys; //try out ten batches, max final boolean isEqual = collectionPersister.getKeyType().isEqual( id, ce.getLoadedKey(), entityMode, collectionPersister.getFactory() ); if ( isEqual ) { end = i; //checkForEnd = false; } else if ( !isCached( ce.getLoadedKey(), collectionPersister, entityMode ) ) { keys[i++] = ce.getLoadedKey(); //count++; } if ( i == batchSize ) { i = 1; //end of array, start filling again from start if ( end != -1 ) { checkForEnd = true;
EntityKey key = (EntityKey) iter.next(); if ( key.getEntityName().equals( persister.getEntityName() ) ) { //TODO: this needn't exclude subclasses... if ( checkForEnd && i == end ) { //the first id found after the given id return ids; } if ( persister.getIdentifierType().isEqual( id, key.getIdentifier(), entityMode ) ) { end = i; } else { if ( !isCached( key, persister, entityMode ) ) { ids[i++] = key.getIdentifier(); } } if ( i == batchSize ) { i = 1; //end of array, start filling again from start if (end!=-1) checkForEnd = true;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/BatchFetchQueue.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/BatchFetchQueue.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
if ( !collection.wasInitialized() && ce.getLoadedPersister() == collectionPersister ) {
1
EntityKey key = (EntityKey) iter.next();
2
			if ( key.getEntityName().equals( persister.getEntityName() ) ) { //TODO: this needn't exclude subclasses...
2
				if ( checkForEnd && i == end ) {
3
				if ( checkForEnd && i == end ) {
3
					return keys; //the first key found after the given key
4
					//the first id found after the given id
4
				}
5
				
5
				//if ( end == -1 && count > batchSize*10 ) return keys; //try out ten batches, max
6
				final boolean isEqual = collectionP
6
	return ids;
7
				}
7
ersister.getKeyType().isEqual(
8
				if ( persister.getIdentifierType().isEqual(
8
						id,
9
						ce.getLoadedKey(),
10
						entityMode,
11
						collectionPersister.getFactory()
12
				);
13
				if ( isEqual ) {
9
 id, key.getIdentifier(), entityMode ) ) {
14
					end = i;
10
					end = i;
15
					//checkForEnd = fa
11
				}
16
lse;
12
				else {
17
				}
13
				
18
				else if ( !isCached( ce.getLoadedKey(), collectionPersister, entityMode ) ) {
14
	if ( !isCached( key, persister, entityMode ) ) {
19
					keys[i++] = ce.getLoadedKey();
15
						ids[i++] = key.get
20
					//count++;
16
Identifier();
17
					}
21
				}
18
				}
22
				if ( i == batchSize ) {
19
				if ( i == batchSize ) {
23
					i = 1; //end of array, start filling again from start
20
					i = 1; //end of array, start filling again from start
24
					if ( end != -1 ) {
21
					if (end!=-1) 
25
						checkForEnd = true;
22
checkForEnd = true;
26
					
23
				
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 location
Number of node comparisons0