openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pinaki Poddar (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (OPENJPA-789) possible NPE
Date Tue, 20 Oct 2009 05:14:59 GMT

     [ 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.


Mime
View raw message