[ 
https://issues.apache.org/jira/browse/TOBAGO-802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767339#action_12767339
 ] 

Udo Schnurpfeil commented on TOBAGO-802:
----------------------------------------

new SelectItem("X", null) should throw an NPE, see JavaDoc 
http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/javax/faces/model/SelectItem.html#SelectItem%28java.lang.Object,%20java.lang.String%29

The logged NPE is an other NPE. 
Can you please check, why the 1st NPE is not logged.

> SelectItem-Name in selectOneChoice is not null-save
> ---------------------------------------------------
>
>                 Key: TOBAGO-802
>                 URL: https://issues.apache.org/jira/browse/TOBAGO-802
>             Project: MyFaces Tobago
>          Issue Type: Bug
>    Affects Versions: 1.0.23
>         Environment: Tobago 1.0.24-SNAPSHOT; java version "1.6.0_16", linux
>            Reporter: Sven Bunge
>            Assignee: Udo Schnurpfeil
>            Priority: Minor
>             Fix For: 1.0.24, 1.1.0
>
>
> A javax.faces.model.SelectItem with an itemName 'null' will result in an 
> strange NPE. Everyone (like me ;-)) will guess that tobago handle it like an 
> empty string.
> Example:
>   public List<SelectItem> getItems() {
>     List<SelectItem> items = new ArrayList<SelectItem>();
>     for (int i = 0; i <a.size(); i++) {
>       items.add(new SelectItem(a.get(i), a.getName())); // a.getName is null
>     }
>     return items;
>   }
> will result in:
> 2009-10-19 11:13:43,342 TP-Processor3 ERROR - 
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/erm].[FacesServlet]:253
>  - Servlet.service() for servlet FacesServlet t
> hrew exception
> java.lang.NullPointerException
>         at 
> org.apache.myfaces.tobago.util.HtmlWriterUtil.writeText(HtmlWriterUtil.java:59)
>         at 
> org.apache.myfaces.tobago.webapp.TobagoResponseWriterImpl.writeText(TobagoResponseWriterImpl.java:178)
>         at 
> org.apache.myfaces.tobago.webapp.TobagoResponseWriter.writeText(TobagoResponseWriter.java:171)
>         at 
> org.apache.myfaces.tobago.renderkit.html.HtmlRendererUtil.renderSelectItems(HtmlRendererUtil.java:641)
>         at 
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.SelectOneChoiceRenderer.encodeEnd(SelectOneChoiceRenderer.java:97)
>         at 
> javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:740)
>         at 
> org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java:86)
>         at 
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent(GridLayoutRenderer.java:379)
>         at 
> org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(UILayout.java:70)
>         at 
> org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent(UIGridLayout.java:276)
>         at 
> org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(UIPanelBase.java:43)
>         at 
> org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java:79)
>         at 
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent(GridLayoutRenderer.java:379)
>         at 
> org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(UILayout.java:70)
>         at 
> org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent(UIGridLayout.java:276)
>         at 
> org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(UIPanelBase.java:43)
>         at 
> org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java:79)
>         at 
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent(GridLayoutRenderer.java:379)
>         at 
> org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(UILayout.java:70)
>         at 
> org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent(UIGridLayout.java:276)
>         at 
> org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(UIPanelBase.java:43)
>         at 
> org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java:79)
>         at 
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent(GridLayoutRenderer.java:379)
>         at 
> org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(UILayout.java:70)
>         at 
> org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent(UIGridLayout.java:276)
>         at 
> org.apache.myfaces.tobago.renderkit.RenderUtil.encodeChildren(RenderUtil.java:58)

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

Reply via email to