You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Max Starets (JIRA)" <de...@myfaces.apache.org> on 2008/11/03 23:54:44 UTC

[jira] Created: (TRINIDAD-1286) RowKeySetTreeImpl.toString() should be more defensive to avoid null pointer exceptions

RowKeySetTreeImpl.toString() should be more defensive to avoid null pointer exceptions
--------------------------------------------------------------------------------------

                 Key: TRINIDAD-1286
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1286
             Project: MyFaces Trinidad
          Issue Type: Bug
          Components: Components
    Affects Versions: 1.2.9-core
            Reporter: Max Starets


RowKeySetTreeImpl inherits toString() implementation from AbstractCollection.
AbstractCollection.toString() is calling iterator(), which is causing a null pointer exception when the collection model is null.
The call stack is the following:
at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$Search.find(RowKeySetTreeImpl.java:652)
	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl._isContained(RowKeySetTreeImpl.java:475)
	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl.access$200(RowKeySetTreeImpl.java:45)
	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$NodeIterator._nextEntry(RowKeySetTreeImpl.java:824)
	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$NodeIterator.nextItem(RowKeySetTreeImpl.java:800)
	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$NodeIterator.<init>(RowKeySetTreeImpl.java:793)
	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl.iterator(RowKeySetTreeImpl.java:92)
	at java.util.AbstractCollection.toString(AbstractCollection.java:414)



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


[jira] Commented: (TRINIDAD-1286) RowKeySetTreeImpl.toString() should be more defensive to avoid null pointer exceptions

Posted by "Pawel Maczka (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12660461#action_12660461 ] 

Pawel Maczka commented on TRINIDAD-1286:
----------------------------------------

Now even with replenished collection model raises the same in 1.2.10:

java.lang.NullPointerException
	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$Search.find(RowKeySetTreeImpl.java:650)
	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl._isContained(RowKeySetTreeImpl.java:474)
	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl.access$200(RowKeySetTreeImpl.java:44)
	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$NodeIterator._nextEntry(RowKeySetTreeImpl.java:822)
	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$NodeIterator.nextItem(RowKeySetTreeImpl.java:798)
	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$NodeIterator.<init>(RowKeySetTreeImpl.java:791)
	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl.iterator(RowKeySetTreeImpl.java:91)
	at java.util.AbstractCollection.toString(AbstractCollection.java:414)

making selecttable treeTable useless.

> RowKeySetTreeImpl.toString() should be more defensive to avoid null pointer exceptions
> --------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-1286
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1286
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 1.2.9-core
>            Reporter: Max Starets
>
> RowKeySetTreeImpl inherits toString() implementation from AbstractCollection.
> AbstractCollection.toString() is calling iterator(), which is causing a null pointer exception when the collection model is null.
> The call stack is the following:
> at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$Search.find(RowKeySetTreeImpl.java:652)
> 	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl._isContained(RowKeySetTreeImpl.java:475)
> 	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl.access$200(RowKeySetTreeImpl.java:45)
> 	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$NodeIterator._nextEntry(RowKeySetTreeImpl.java:824)
> 	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$NodeIterator.nextItem(RowKeySetTreeImpl.java:800)
> 	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$NodeIterator.<init>(RowKeySetTreeImpl.java:793)
> 	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl.iterator(RowKeySetTreeImpl.java:92)
> 	at java.util.AbstractCollection.toString(AbstractCollection.java:414)

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


[jira] Commented: (TRINIDAD-1286) RowKeySetTreeImpl.toString() should be more defensive to avoid null pointer exceptions

Posted by "Andrew Robinson (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12660499#action_12660499 ] 

Andrew Robinson commented on TRINIDAD-1286:
-------------------------------------------

How did you get into a state where the collection model is null? This is set no in the getter of the FacesBean. So the only way I would see this happening is if some state is invalid in your app. Could you please submit a maven test case to reproduce the issue or a way to reproduce the problem with the demo app?

> RowKeySetTreeImpl.toString() should be more defensive to avoid null pointer exceptions
> --------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-1286
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1286
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 1.2.9-core
>            Reporter: Max Starets
>
> RowKeySetTreeImpl inherits toString() implementation from AbstractCollection.
> AbstractCollection.toString() is calling iterator(), which is causing a null pointer exception when the collection model is null.
> The call stack is the following:
> at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$Search.find(RowKeySetTreeImpl.java:652)
> 	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl._isContained(RowKeySetTreeImpl.java:475)
> 	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl.access$200(RowKeySetTreeImpl.java:45)
> 	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$NodeIterator._nextEntry(RowKeySetTreeImpl.java:824)
> 	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$NodeIterator.nextItem(RowKeySetTreeImpl.java:800)
> 	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$NodeIterator.<init>(RowKeySetTreeImpl.java:793)
> 	at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl.iterator(RowKeySetTreeImpl.java:92)
> 	at java.util.AbstractCollection.toString(AbstractCollection.java:414)

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