1
1
using System ;
2
2
using System . Collections . Generic ;
3
- using System . Linq ;
4
3
using Iesi . Collections . Generic ;
5
4
using NHibernate . Engine ;
6
- using NHibernate . Persister . Entity ;
7
5
using NHibernate . Proxy ;
8
6
using NHibernate . Util ;
9
7
@@ -22,8 +20,7 @@ public abstract class AbstractFieldInterceptor : IFieldInterceptor
22
20
private readonly HashSet < string > loadedUnwrapProxyFieldNames = new HashSet < string > ( ) ;
23
21
private readonly string entityName ;
24
22
private readonly System . Type mappedClass ;
25
- private readonly string [ ] originalUninitializedFields ;
26
-
23
+
27
24
[ NonSerialized ]
28
25
private bool initializing ;
29
26
private bool isDirty ;
@@ -36,7 +33,6 @@ protected internal AbstractFieldInterceptor(ISessionImplementor session, ISet<st
36
33
this . entityName = entityName ;
37
34
this . mappedClass = mappedClass ;
38
35
this . uninitializedFieldsReadOnly = uninitializedFields != null ? new ReadOnlySet < string > ( new HashSet < string > ( uninitializedFields ) ) : null ;
39
- this . originalUninitializedFields = uninitializedFields != null ? uninitializedFields . ToArray ( ) : null ;
40
36
}
41
37
42
38
#region IFieldInterceptor Members
@@ -215,12 +211,9 @@ public ISet<string> GetUninitializedFields()
215
211
216
212
public void ClearInitializedLazyFields ( )
217
213
{
218
- if ( this . originalUninitializedFields == null )
219
- return ;
220
-
221
- foreach ( var originalUninitializedField in this . originalUninitializedFields )
214
+ if ( uninitializedFieldsReadOnly != null )
222
215
{
223
- this . uninitializedFields . Add ( originalUninitializedField ) ;
216
+ uninitializedFields . UnionWith ( uninitializedFieldsReadOnly ) ;
224
217
}
225
218
}
226
219
}
0 commit comments