You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Pinaki Poddar (JIRA)" <ji...@apache.org> on 2009/10/20 07:14:59 UTC

[jira] Resolved: (OPENJPA-789) possible NPE

     [ https://issues.apache.org/jira/browse/OPENJPA-789?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pinaki Poddar resolved OPENJPA-789.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0-M3

> possible NPE
> ------------
>
>                 Key: OPENJPA-789
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-789
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 2.0.0-M2
>            Reporter: Fernando
>            Assignee: Pinaki Poddar
>            Priority: Trivial
>             Fix For: 2.0.0-M3
>
>
> Still reviewing code.
> This time in kernel/QueryImpl.java.  You see that "assertNotSerialized()" method, if you go look at that, it just checks to see if "_broker == null", but just the line before that method call, we use "_broker.beginOperation(true)".  So the check happens a second too late to prevent an NPE.  I think that assertNotSerialized should be moved up to be the first line in the method.  No sense doing any work what so ever, if we don't have a broker.
> NOW:
>     private Object execute(int operation, Map params) {
>         if (params == null)
>             params = Collections.EMPTY_MAP;
>         lock();
>         try {
>             _broker.beginOperation(true);
>             try {
>                 assertNotSerialized();
>                 assertOpen();
> ....
> TO:
>     private Object execute(int operation, Map params) {
>         assertNotSerialized();
>         if (params == null)
>             params = Collections.EMPTY_MAP;
>         lock();
>         try {
>             _broker.beginOperation(true);
>             try {
>                 assertOpen();
> ....

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.