HHH-6862 final polish

This commit is contained in:
Sanne Grinovero 2011-11-29 19:48:58 +00:00 committed by Strong Liu
parent d12396ee37
commit 7781cb0aa9
2 changed files with 3 additions and 4 deletions

View File

@ -112,7 +112,7 @@ public class StatefulPersistenceContext implements PersistenceContext {
private Map<Object, PersistentCollection> arrayHolders;
// Identity map of CollectionEntry instances, by the collection wrapper
private Map<PersistentCollection, CollectionEntry> collectionEntries;
private IdentityMap<PersistentCollection, CollectionEntry> collectionEntries;
// Collection wrappers, by the CollectionKey
private Map<CollectionKey, PersistentCollection> collectionsByKey;
@ -223,8 +223,7 @@ public class StatefulPersistenceContext implements PersistenceContext {
final LazyInitializer li = ((HibernateProxy) o).getHibernateLazyInitializer();
li.unsetSession();
}
Map.Entry<PersistentCollection, CollectionEntry>[] collectionEntryArray = IdentityMap.concurrentEntries( collectionEntries );
for ( Map.Entry<PersistentCollection, CollectionEntry> aCollectionEntryArray : collectionEntryArray ) {
for ( Map.Entry<PersistentCollection, CollectionEntry> aCollectionEntryArray : IdentityMap.concurrentEntries( collectionEntries ) ) {
aCollectionEntryArray.getKey().unsetSession( getSession() );
}
arrayHolders.clear();

View File

@ -90,7 +90,7 @@ public final class IdentityMap<K,V> implements Map<K,V> {
return ( (IdentityMap<K,V>) map ).entryArray();
}
public static <K,V> Iterator<K> keyIterator(Map<K,V> map) {
public static <K,V> Iterator<K> keyIterator(IdentityMap<K,V> map) {
return ( (IdentityMap<K,V>) map ).keyIterator();
}