[jira] Created: (WW-3311) NullPointerException in CheckboxInterceptor when parameters are null

View: New views
8 Messages — Rating Filter:   Alert me  

[jira] Created: (WW-3311) NullPointerException in CheckboxInterceptor when parameters are null

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

NullPointerException in CheckboxInterceptor when parameters are null
--------------------------------------------------------------------

                 Key: WW-3311
                 URL: https://issues.apache.org/struts/browse/WW-3311
             Project: Struts 2
          Issue Type: Bug
          Components: Core Interceptors
    Affects Versions: 2.1.6
         Environment: Struts 2.1.6, but no changes in 2.1.8
            Reporter: Cimballi


There is a NullPointerException in the CheckboxInterceptor when parameters are null at the following line :
Set<Map.Entry> entries = parameters.entrySet();

I don't know if "theorically" it should check or not for null parameters, but the XWork interceptors check it, so I think Struts2 interceptors should also check for null parameters.


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


[jira] Updated: (WW-3311) NullPointerException in CheckboxInterceptor when parameters are null

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Musachy Barroso updated WW-3311:
--------------------------------

    Fix Version/s: 2.2.0

> NullPointerException in CheckboxInterceptor when parameters are null
> --------------------------------------------------------------------
>
>                 Key: WW-3311
>                 URL: https://issues.apache.org/struts/browse/WW-3311
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.1.6
>         Environment: Struts 2.1.6, but no changes in 2.1.8
>            Reporter: Cimballi
>             Fix For: 2.2.0
>
>
> There is a NullPointerException in the CheckboxInterceptor when parameters are null at the following line :
> Set<Map.Entry> entries = parameters.entrySet();
> I don't know if "theorically" it should check or not for null parameters, but the XWork interceptors check it, so I think Struts2 interceptors should also check for null parameters.

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


[jira] Commented: (WW-3311) NullPointerException in CheckboxInterceptor when parameters are null

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/struts/browse/WW-3311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47004#action_47004 ]

Musachy Barroso commented on WW-3311:
-------------------------------------

how can the parameters be null? I thought that was no possible

> NullPointerException in CheckboxInterceptor when parameters are null
> --------------------------------------------------------------------
>
>                 Key: WW-3311
>                 URL: https://issues.apache.org/struts/browse/WW-3311
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.1.6
>         Environment: Struts 2.1.6, but no changes in 2.1.8
>            Reporter: Cimballi
>             Fix For: 2.2.0
>
>
> There is a NullPointerException in the CheckboxInterceptor when parameters are null at the following line :
> Set<Map.Entry> entries = parameters.entrySet();
> I don't know if "theorically" it should check or not for null parameters, but the XWork interceptors check it, so I think Struts2 interceptors should also check for null parameters.

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


[jira] Resolved: (WW-3311) NullPointerException in CheckboxInterceptor when parameters are null

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Musachy Barroso resolved WW-3311.
---------------------------------

    Resolution: Won't Fix

the solution is to create your own class that contains 2 longs and overwrites equals and hash

> NullPointerException in CheckboxInterceptor when parameters are null
> --------------------------------------------------------------------
>
>                 Key: WW-3311
>                 URL: https://issues.apache.org/struts/browse/WW-3311
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.1.6
>         Environment: Struts 2.1.6, but no changes in 2.1.8
>            Reporter: Cimballi
>             Fix For: 2.2.0
>
>
> There is a NullPointerException in the CheckboxInterceptor when parameters are null at the following line :
> Set<Map.Entry> entries = parameters.entrySet();
> I don't know if "theorically" it should check or not for null parameters, but the XWork interceptors check it, so I think Struts2 interceptors should also check for null parameters.

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


[jira] Commented: (WW-3311) NullPointerException in CheckboxInterceptor when parameters are null

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/struts/browse/WW-3311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47007#action_47007 ]

Cimballi commented on WW-3311:
------------------------------

In fact, I set params to null in a test method and that's how I encounter the problem.
Don't you think it's better to have the same behaviour in Struts2 classes than in XWork classes, instead of having everybody who encouters this problem writing its own derived class ?

> NullPointerException in CheckboxInterceptor when parameters are null
> --------------------------------------------------------------------
>
>                 Key: WW-3311
>                 URL: https://issues.apache.org/struts/browse/WW-3311
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.1.6
>         Environment: Struts 2.1.6, but no changes in 2.1.8
>            Reporter: Cimballi
>             Fix For: 2.2.0
>
>
> There is a NullPointerException in the CheckboxInterceptor when parameters are null at the following line :
> Set<Map.Entry> entries = parameters.entrySet();
> I don't know if "theorically" it should check or not for null parameters, but the XWork interceptors check it, so I think Struts2 interceptors should also check for null parameters.

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


[jira] Commented: (WW-3311) NullPointerException in CheckboxInterceptor when parameters are null

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/struts/browse/WW-3311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47008#action_47008 ]

Musachy Barroso commented on WW-3311:
-------------------------------------

well, yes I would agree to check for null if they *can* be null, but they are guaranteed to not be null by the framework (if you set them to null by hand, then yes it will fail, it might break in other places as well)

> NullPointerException in CheckboxInterceptor when parameters are null
> --------------------------------------------------------------------
>
>                 Key: WW-3311
>                 URL: https://issues.apache.org/struts/browse/WW-3311
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.1.6
>         Environment: Struts 2.1.6, but no changes in 2.1.8
>            Reporter: Cimballi
>             Fix For: 2.2.0
>
>
> There is a NullPointerException in the CheckboxInterceptor when parameters are null at the following line :
> Set<Map.Entry> entries = parameters.entrySet();
> I don't know if "theorically" it should check or not for null parameters, but the XWork interceptors check it, so I think Struts2 interceptors should also check for null parameters.

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


[jira] Commented: (WW-3311) NullPointerException in CheckboxInterceptor when parameters are null

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/struts/browse/WW-3311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47009#action_47009 ]

Cimballi commented on WW-3311:
------------------------------

What's strange is that I identified the problem only when I start using the CheckboxInterceptor, which is a Struts2 initerceptor. If you look at the ParametersInterceptor and the ParameterRemoverInterceptor, which are XWork2 interceptors, they both check for null for the parameters. I think both frameworks should behave the same. Well, that's my point of view as a user, I let the developers choose... :-)

> NullPointerException in CheckboxInterceptor when parameters are null
> --------------------------------------------------------------------
>
>                 Key: WW-3311
>                 URL: https://issues.apache.org/struts/browse/WW-3311
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.1.6
>         Environment: Struts 2.1.6, but no changes in 2.1.8
>            Reporter: Cimballi
>             Fix For: 2.2.0
>
>
> There is a NullPointerException in the CheckboxInterceptor when parameters are null at the following line :
> Set<Map.Entry> entries = parameters.entrySet();
> I don't know if "theorically" it should check or not for null parameters, but the XWork interceptors check it, so I think Struts2 interceptors should also check for null parameters.

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


[jira] Commented: (WW-3311) NullPointerException in CheckboxInterceptor when parameters are null

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/struts/browse/WW-3311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47010#action_47010 ]

Musachy Barroso commented on WW-3311:
-------------------------------------

we appreciate the report. I think what we should do is remove the null check in xwork, for consistency

> NullPointerException in CheckboxInterceptor when parameters are null
> --------------------------------------------------------------------
>
>                 Key: WW-3311
>                 URL: https://issues.apache.org/struts/browse/WW-3311
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.1.6
>         Environment: Struts 2.1.6, but no changes in 2.1.8
>            Reporter: Cimballi
>             Fix For: 2.2.0
>
>
> There is a NullPointerException in the CheckboxInterceptor when parameters are null at the following line :
> Set<Map.Entry> entries = parameters.entrySet();
> I don't know if "theorically" it should check or not for null parameters, but the XWork interceptors check it, so I think Struts2 interceptors should also check for null parameters.

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