Skip to content

Commit eb162c6

Browse files
fixup! Recompute hashcodes on deserialization
Additional cleanup
1 parent f162ede commit eb162c6

File tree

3 files changed

+0
-14
lines changed

3 files changed

+0
-14
lines changed

src/NHibernate/Cache/FilterKey.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public override int GetHashCode()
5050
{
5151
var result = 13;
5252
result = 37 * result + _filterName.GetHashCode();
53-
5453
result = 37 * result + CollectionHelper.GetHashCode(_filterParameters, NamedParameterComparer.Instance);
5554
return result;
5655
}

src/NHibernate/Engine/EntityKey.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,5 @@ public override string ToString()
110110
{
111111
return "EntityKey" + MessageHelper.InfoString(factory.GetEntityPersister(EntityName), Identifier, factory);
112112
}
113-
114-
/// <summary>
115-
/// To use in deserialization callback
116-
/// </summary>
117-
/// <param name="sessionFactory"></param>
118-
internal void SetSessionFactory(ISessionFactoryImplementor sessionFactory)
119-
{
120-
factory = sessionFactory;
121-
}
122113
}
123114
}

src/NHibernate/LockMode.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,6 @@ public bool Equals(LockMode other)
121121

122122
public override int GetHashCode()
123123
{
124-
// If the object is put in a set or dictionary during deserialization, the hashcode will not yet be
125-
// computed. Compute the hashcode on the fly. So long as this happens only during deserialization, there
126-
// will be no thread safety issues. For the hashcode to be always defined after deserialization, the
127-
// deserialization callback is used.
128124
unchecked
129125
{
130126
return (level * 37) ^ (name?.GetHashCode() ?? 0);

0 commit comments

Comments
 (0)