Skip to content

Commit a9f417c

Browse files
committed
Revert "Replace CollectionCacheEntry constructor with factory method"
This reverts commit a37f371.
1 parent e2b3ab3 commit a9f417c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/NHibernate/Action/CollectionUpdateAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public override AfterTransactionCompletionProcessDelegate AfterTransactionComple
139139
// or detached from the session
140140
if (Collection.WasInitialized && Session.PersistenceContext.ContainsCollection(Collection))
141141
{
142-
CollectionCacheEntry entry = CollectionCacheEntry.Create(Collection, Persister);
142+
CollectionCacheEntry entry = new CollectionCacheEntry(Collection, Persister);
143143
bool put = Persister.Cache.AfterUpdate(ck, entry, null, Lock);
144144

145145
if (put && Session.Factory.Statistics.IsStatisticsEnabled)

src/NHibernate/Cache/Entry/CollectionCacheEntry.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ public partial class CollectionCacheEntry
1010
{
1111
private readonly object state;
1212

13-
public static CollectionCacheEntry Create(IPersistentCollection collection, ICollectionPersister persister)
13+
public CollectionCacheEntry(IPersistentCollection collection, ICollectionPersister persister)
1414
{
15-
return new CollectionCacheEntry(collection.Disassemble(persister));
15+
state = collection.Disassemble(persister);
1616
}
1717

1818
internal CollectionCacheEntry(object state)

src/NHibernate/Engine/Loading/CollectionLoadContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ private void AddCollectionToCache(LoadingCollectionEntry lce, ICollectionPersist
318318
versionComparator = null;
319319
}
320320

321-
CollectionCacheEntry entry = CollectionCacheEntry.Create(lce.Collection, persister);
321+
CollectionCacheEntry entry = new CollectionCacheEntry(lce.Collection, persister);
322322
CacheKey cacheKey = session.GenerateCacheKey(lce.Key, persister.KeyType, persister.Role);
323323
bool put = persister.Cache.Put(cacheKey, persister.CacheEntryStructure.Structure(entry),
324324
session.Timestamp, version, versionComparator,

0 commit comments

Comments
 (0)