Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/classes/java/util/prefs/AbstractPreferences.java
          +++ new/src/share/classes/java/util/prefs/AbstractPreferences.java
↓ open down ↓ 297 lines elided ↑ open up ↑
 298  298       *
 299  299       * <p>This implementation obtains this preference node's lock,
 300  300       * checks that the node has not been removed, invokes
 301  301       * {@link #removeSpi(String)} and if there are any preference
 302  302       * change listeners, enqueues a notification event for processing by the
 303  303       * event dispatch thread.
 304  304       *
 305  305       * @param key key whose mapping is to be removed from the preference node.
 306  306       * @throws IllegalStateException if this node (or an ancestor) has been
 307  307       *         removed with the {@link #removeNode()} method.
      308 +     * @throws NullPointerException {@inheritDoc}.
 308  309       */
 309  310      public void remove(String key) {
      311 +        Objects.requireNonNull(key, "Specified key cannot be null");
 310  312          synchronized(lock) {
 311  313              if (removed)
 312  314                  throw new IllegalStateException("Node has been removed.");
 313  315  
 314  316              removeSpi(key);
 315  317              enqueuePreferenceChangeEvent(key, null);
 316  318          }
 317  319      }
 318  320  
 319  321      /**
↓ open down ↓ 1294 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX