[hibernate-issues] [Hibernate-JIRA] Assigned: (HHH-5195) FilterImpl.validate() throws NullPointerExeption at line 164

Gail Badner (JIRA) noreply at atlassian.com
Tue May 18 13:37:11 EDT 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gail Badner reassigned HHH-5195:
--------------------------------

    Assignee: Gail Badner

> FilterImpl.validate() throws NullPointerExeption at line 164
> ------------------------------------------------------------
>
>                 Key: HHH-5195
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5195
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.5.1
>         Environment: hibernate-distribution-3.5.1-Final-dist
>            Reporter: Savochkin Alexander
>            Assignee: Gail Badner
>             Fix For: 3.5.x, 3.6
>
>         Attachments: HHH-5195-testsuite.diff, HHH-5195.diff
>
>
> After deserialization NPE is thrown at this line
> FilterImpl
> {code}
> line:164
> Iterator itr = definition.getParameterNames().iterator();
> {code}
> the last lines from stack trace are:
> {code}
> java.lang.NullPointerException
>         at org.hibernate.impl.FilterImpl.validate(FilterImpl.java:164)
>         at org.hibernate.engine.LoadQueryInfluencers.getEnabledFilters(LoadQueryInfluencers.java:109)
>         at org.hibernate.impl.SessionImpl.readObject(SessionImpl.java:2144)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
>         at java.lang.reflect.Method.invoke(Method.java:600)
>         at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:986)
>         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1865)
>         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)
>         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1345)
>         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:364)
> {code}
> Looking at SessionImpl class we see:
> {code}
> line 2143:
> Iterator iter = loadQueryInfluencers.getEnabledFilters().values().iterator();
> 		while ( iter.hasNext() ) {
> 			( ( FilterImpl ) iter.next() ).afterDeserialize( factory );
> 		}
> {code}
> LoadQueryInfluencers:
> {code}
> line:105
> Iterator itr = enabledFilters.values().iterator();
> 		while ( itr.hasNext() ) {
> 			final Filter filter = ( Filter ) itr.next();
> 			filter.validate();
> 		}
> {code}
> So, afterDeserialization() on enabled filters method is invoked AFTER getEnabledFilters() method is.
> It seems to be the reason why the private TRANSIENT field "definition" of every filter is null at the moment of filter validation!
> "definition" field is supposed to be initialized only after validate() is called.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list