You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Fernando (JIRA)" <ji...@apache.org> on 2008/11/26 18:42:44 UTC
[jira] Created: (OPENJPA-789) possible NPE
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
Reporter: Fernando
Priority: Trivial
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.
[jira] Resolved: (OPENJPA-789) possible NPE
Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Assigned: (OPENJPA-789) possible NPE
Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-789?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pinaki Poddar reassigned OPENJPA-789:
-------------------------------------
Assignee: Pinaki Poddar
> 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.