Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5026830

(process) Improve Set returned by ProcessBuilder.environment().entrySet()

    • b48
    • generic
    • generic

      The contains(Object) and remove(Object) methods of Set implemented for
      the Set<Map.Entry<String,String>> returned by the entrySet() method
      of the Map<String,String> returned by ProcessBuilder.environment()
      and implemented in the ProcessEnvironment.java files for Unix and Windows
      have the following issues:

      This code is currently accepted by Tiger's javac, but an imminent putback
      will make this a compile error:

      instanceof Map.Entry<String,String>

      Further, these methods should throw the optional NullPointerException
      and ClassCastExceptions as documented in Set.java.

      A previous fix
       4932663 (process) Add more runtime error checking for environment map operation
      ensured that these exceptions were thrown for other relevant methods, such
      as ProcessEnvironment.environment().keySet().contains(Object)

      This should be made consistent.

      The following desirable property of Set is not satisfied by the set returned
      by entrySet

      For each element e of the Set s as returned by its iterator,
      it should be true that
      s.contains(e)

      ###@###.### 2004-04-05

            martin Martin Buchholz
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: