Jetspeed 2
  1. Jetspeed 2
  2. JS2-607

An error occur when trying storing a null value in preferences

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-FINAL, 2.1-dev
    • Fix Version/s: 2.1-dev, 2.1
    • Labels:
      None
    • Environment:
      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.

        Activity

        Marc F. created issue -
        Ate Douma made changes -
        Field Original Value New Value
        Assignee Ate Douma [ adouma ]
        Ate Douma made changes -
        Affects Version/s 2.1-dev [ 12310686 ]
        Fix Version/s 2.1 [ 12310617 ]
        Fix Version/s 2.1-dev [ 12310686 ]
        Ate Douma made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Ate Douma made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ate Douma made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Ate Douma
            Reporter:
            Marc F.
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development