[jira] [Created] (OFBIZ-4399) Possible null pointer exception

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (OFBIZ-4399) Possible null pointer exception

Nicolas Malin (Jira)
Possible null pointer exception
-------------------------------

                 Key: OFBIZ-4399
                 URL: https://issues.apache.org/jira/browse/OFBIZ-4399
             Project: OFBiz
          Issue Type: Bug
          Components: framework
            Reporter: Dimitri Unruh
            Priority: Minor
         Attachments: OFBIZ-4399.patch

Hi everybody,

in UtilCache.getNextDefaultIndex(String cacheName) the return value the curInd object is dereferenced without a null check.
This may lead to a NullPointerException when the code is executed.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (OFBIZ-4399) Possible null pointer exception

Nicolas Malin (Jira)

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

Dimitri Unruh updated OFBIZ-4399:
---------------------------------

    Attachment: OFBIZ-4399.patch

> Possible null pointer exception
> -------------------------------
>
>                 Key: OFBIZ-4399
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4399
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>            Reporter: Dimitri Unruh
>            Priority: Minor
>         Attachments: OFBIZ-4399.patch
>
>
> Hi everybody,
> in UtilCache.getNextDefaultIndex(String cacheName) the return value the curInd object is dereferenced without a null check.
> This may lead to a NullPointerException when the code is executed.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4399) Possible null pointer exception

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13100423#comment-13100423 ]

Adrian Crum commented on OFBIZ-4399:
------------------------------------

It appears to me that any condition that would result in a null reference would throw an exception before the null reference is used.


> Possible null pointer exception
> -------------------------------
>
>                 Key: OFBIZ-4399
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4399
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>            Reporter: Dimitri Unruh
>            Priority: Minor
>         Attachments: OFBIZ-4399.patch
>
>
> Hi everybody,
> in UtilCache.getNextDefaultIndex(String cacheName) the return value the curInd object is dereferenced without a null check.
> This may lead to a NullPointerException when the code is executed.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4399) Possible null pointer exception

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13100524#comment-13100524 ]

Dimitri Unruh commented on OFBIZ-4399:
--------------------------------------

Adrian,

maybe you are right. For me it is just a "code styling" question.
So fell free to close it :)

> Possible null pointer exception
> -------------------------------
>
>                 Key: OFBIZ-4399
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4399
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>            Reporter: Dimitri Unruh
>            Priority: Minor
>         Attachments: OFBIZ-4399.patch
>
>
> Hi everybody,
> in UtilCache.getNextDefaultIndex(String cacheName) the return value the curInd object is dereferenced without a null check.
> This may lead to a NullPointerException when the code is executed.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Closed] (OFBIZ-4399) Possible null pointer exception

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Jacques Le Roux closed OFBIZ-4399.
----------------------------------

    Resolution: Not A Problem
      Assignee: Adrian Crum

I agree with Adrian, putIfAbsent would throw a NullPointerException.

BTW, another if w/out braces in putIfAbsent :p

> Possible null pointer exception
> -------------------------------
>
>                 Key: OFBIZ-4399
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4399
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>            Reporter: Dimitri Unruh
>            Assignee: Adrian Crum
>            Priority: Minor
>         Attachments: OFBIZ-4399.patch
>
>
> Hi everybody,
> in UtilCache.getNextDefaultIndex(String cacheName) the return value the curInd object is dereferenced without a null check.
> This may lead to a NullPointerException when the code is executed.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira