You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Rob Decker (JIRA)" <in...@incubator.apache.org> on 2005/04/01 22:45:19 UTC

[jira] Created: (MYFACES-160) HtmlTree.isNodeSelected doesn't check for null node id

HtmlTree.isNodeSelected doesn't check for null node id
------------------------------------------------------

         Key: MYFACES-160
         URL: http://issues.apache.org/jira/browse/MYFACES-160
     Project: MyFaces
        Type: Bug
    Versions: 1.0.9 beta    
 Environment: All
    Reporter: Rob Decker
    Priority: Minor


Apparently UITreeData can return a null node id when getNodeId() is called. HtmlTree.isNodeSelected() doesn't check for a null id and dumps a long strack trace in the log. It would be nicer for the log file if checked for a null value:

return (getNodeId() != null) ? getNodeId().equals(_selectedNodeId) : false;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-160) HtmlTree.isNodeSelected doesn't check for null node id

Posted by "sean schofield (JIRA)" <in...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-160?page=comments#action_62058 ]
     
sean schofield commented on MYFACES-160:
----------------------------------------

I am happy to make this fix.  Before I do I would like to understand why you are seeing a stack trace and I am not.  I'd like to know where my logic is breaking down.

> HtmlTree.isNodeSelected doesn't check for null node id
> ------------------------------------------------------
>
>          Key: MYFACES-160
>          URL: http://issues.apache.org/jira/browse/MYFACES-160
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>  Environment: All
>     Reporter: Rob Decker
>     Priority: Minor

>
> Apparently UITreeData can return a null node id when getNodeId() is called. HtmlTree.isNodeSelected() doesn't check for a null id and dumps a long strack trace in the log. It would be nicer for the log file if checked for a null value:
> return (getNodeId() != null) ? getNodeId().equals(_selectedNodeId) : false;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-160) HtmlTree.isNodeSelected doesn't check for null node id

Posted by "sean schofield (JIRA)" <in...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-160?page=comments#action_62150 ]
     
sean schofield commented on MYFACES-160:
----------------------------------------

I have been thinking about this some more.  At no point should getNodeId() return null.  It would appear this fix is unecessary.  If this value is ever null at some point we need to understand why.  During the rendering of tree2 this value is set and incremented properly (as near as I can tell.)  The rendering of tree *depends* on this being the case (similar to dataTable and the rowIndex property.)

> HtmlTree.isNodeSelected doesn't check for null node id
> ------------------------------------------------------
>
>          Key: MYFACES-160
>          URL: http://issues.apache.org/jira/browse/MYFACES-160
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>  Environment: All
>     Reporter: Rob Decker
>     Assignee: sean schofield
>     Priority: Minor

>
> Apparently UITreeData can return a null node id when getNodeId() is called. HtmlTree.isNodeSelected() doesn't check for a null id and dumps a long strack trace in the log. It would be nicer for the log file if checked for a null value:
> return (getNodeId() != null) ? getNodeId().equals(_selectedNodeId) : false;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-160) HtmlTree.isNodeSelected doesn't check for null node id

Posted by "Rob Decker (JIRA)" <in...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-160?page=comments#action_62230 ]
     
Rob Decker commented on MYFACES-160:
------------------------------------

The code specifically calls setNodeId(null) in HtmlTree.encodeChildren. It's also null prior to being restored. I think the issue is that it fills the logs with an uneeded stack trace (since it isn't actually breaking anything when it's null). If you want to keep track of it until you or someone has a chance to figure it out (or it does break something and we just haven't seen it yet) I think it would be better to just check it for null, log a warning, and return from the method rather than fill the logs with a stack trace about npe that didn't break anything. (we get enough of that from jsps). At least that way if something else does go wrong it'll be a clue (or mislead).

I've only seen the issue on Linux/Tomcat 4.x and 5.0x. It never showed up in windows running tomcat 5.0x. 

> HtmlTree.isNodeSelected doesn't check for null node id
> ------------------------------------------------------
>
>          Key: MYFACES-160
>          URL: http://issues.apache.org/jira/browse/MYFACES-160
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>  Environment: All
>     Reporter: Rob Decker
>     Assignee: sean schofield
>     Priority: Minor

>
> Apparently UITreeData can return a null node id when getNodeId() is called. HtmlTree.isNodeSelected() doesn't check for a null id and dumps a long strack trace in the log. It would be nicer for the log file if checked for a null value:
> return (getNodeId() != null) ? getNodeId().equals(_selectedNodeId) : false;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (MYFACES-160) HtmlTree.isNodeSelected doesn't check for null node id

Posted by "Rob Decker (JIRA)" <in...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-160?page=history ]

Rob Decker updated MYFACES-160:
-------------------------------

    Attachment: nodeId_npe.patch

> HtmlTree.isNodeSelected doesn't check for null node id
> ------------------------------------------------------
>
>          Key: MYFACES-160
>          URL: http://issues.apache.org/jira/browse/MYFACES-160
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>  Environment: All
>     Reporter: Rob Decker
>     Assignee: sean schofield
>     Priority: Minor
>  Attachments: nodeId_npe.patch
>
> Apparently UITreeData can return a null node id when getNodeId() is called. HtmlTree.isNodeSelected() doesn't check for a null id and dumps a long strack trace in the log. It would be nicer for the log file if checked for a null value:
> return (getNodeId() != null) ? getNodeId().equals(_selectedNodeId) : false;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira