[ 
http://issues.apache.org/jira/browse/COCOON-1785?page=comments#action_12368215 
] 

Antonio Gallardo commented on COCOON-1785:
------------------------------------------

String.valueOf() replace null --> "null" [1]

Is this the expected behavior? Is not better to log the error or to throw the 
exception?

[1] 
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#valueOf(java.lang.Object)

> I18nMessage - null parameter values causes NPE
> ----------------------------------------------
>
>          Key: COCOON-1785
>          URL: http://issues.apache.org/jira/browse/COCOON-1785
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8, 2.1.9-dev (current SVN)
>     Reporter: Eric Meyer
>     Assignee: Antonio Gallardo
>  Attachments: I18nMessageNPE.txt
>
> Putting a null in a parameter value causes an NPE when creating the SAX events
> java.lang.NullPointerException
>       at org.apache.cocoon.forms.util.I18nMessage.toSAX(I18nMessage.java:128)
>       at 
> org.apache.cocoon.forms.validation.ValidationError.generateSaxFragment(ValidationError.java:85)
>       at 
> org.apache.cocoon.forms.formmodel.Field.generateItemSaxFragment(Field.java:453)
>       at 
> org.apache.cocoon.forms.formmodel.AbstractWidget.generateSaxFragment(AbstractWidget.java:498)
>       at 
> org.apache.cocoon.forms.generation.JXMacrosHelper.generateWidget(JXMacrosHelper.java:292)
> Note: this NPE then causes the Ajax transformer to go wonky for all users in 
> all sessions. I'm still digging into that one.
> I am attaching a patch (license granted to ASF)  that allows null parameter 
> values (using String.valueOf(parameters[i]) so that nulls are turned into 
> "null".

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to