HHH-5195 : FilterImpl.validate() throws NullPointerException on deserialization
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@19730 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
3c57a05313
commit
6d9c10deab
|
@ -51,6 +51,7 @@ public class FilterImpl implements Filter, Serializable {
|
|||
|
||||
void afterDeserialize(SessionFactoryImpl factory) {
|
||||
definition = factory.getFilterDefinition(filterName);
|
||||
validate();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2152,14 +2152,12 @@ public final class SessionImpl extends AbstractSessionImpl
|
|||
|
||||
// LoadQueryInfluencers.getEnabledFilters() tries to validate each enabled
|
||||
// filter, which will fail when called before FilterImpl.afterDeserialize( factory );
|
||||
// Instead lookup the filter by name, call FilterImpl.afterDeserialize( factory ),
|
||||
// and then validate.
|
||||
// Instead lookup the filter by name and then call FilterImpl.afterDeserialize( factory ).
|
||||
Iterator iter = loadQueryInfluencers.getEnabledFilterNames().iterator();
|
||||
while ( iter.hasNext() ) {
|
||||
String filterName = ( String ) iter.next();
|
||||
FilterImpl filter = ( FilterImpl ) loadQueryInfluencers.getEnabledFilter( filterName );
|
||||
filter.afterDeserialize( factory );
|
||||
filter.validate();
|
||||
( ( FilterImpl ) loadQueryInfluencers.getEnabledFilter( filterName ) )
|
||||
.afterDeserialize( factory );
|
||||
}
|
||||
|
||||
if ( isRootSession && childSessionsByEntityMode != null ) {
|
||||
|
|
Loading…
Reference in New Issue