Uploaded image for project: 'Jetspeed 2 (Retired)'
  1. Jetspeed 2 (Retired)
  2. JS2-607

An error occur when trying storing a null value in preferences

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-FINAL, 2.1-dev
    • 2.1-dev, 2.1
    • None
    • Windows XP.

    Description

      When I try storing a null value, like below:

      public void processAction(ActionRequest aRequest, ActionResponse aResponse)
      throws PortletException, IOException {

      //...
      PortletPreferences prefs = aRequest.getPreferences();
      prefs.setValue("cellPhone", null);
      //...
      }

      An exception occur:

      java.lang.NullPointerException
      at java.util.prefs.AbstractPreferences.put(AbstractPreferences.java
      :224)
      at org.apache.jetspeed.om.preference.impl.PrefsPreference.setValueAt
      (PrefsPreference.java:138)
      at org.apache.jetspeed.om.preference.impl.PrefsPreference.setValues(
      PrefsPreference.java:235)
      etc...

      It occurs only when I try storing a null value. It is not in conformity to the Portlet API documentation:

      "The key cannot be null, but null values for the value parameter are
      allowed."

      Certainly Jetspeed 2 is not obeying the rules very
      well.

      Attachments

        Activity

          People

            ate Ate Douma
            marc_f Marc F.
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: