Uploaded image for project: 'Cocoon'
  1. Cocoon
  2. COCOON-1785

I18nMessage - null parameter values causes NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.8, 2.1.9
    • None
    • Blocks: Forms
    • None
    • Patch available

    Description

      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".

      Attachments

        Activity

          People

            antonio Antonio Gallardo Rivera
            eric.meyer Eric Meyer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: