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

Incompatible changes in java.util Properties and Hashtable

XMLWordPrintable



      Name: tb29552 Date: 09/24/98


      The changes to Properties and Hashtable breaks old code -
      unnecessarily imho.

      1. Properties.put(Object, Object) no longer supports anything that is not a
      String, which means that a Properties no longer is a Hashtable. Anyone
      using the Properties class for the extra convenience of the getProperty
      method for getting Strings will get into trouble.

      The new method may or may not be a good thing in itself - but I don't
      see why it is important enough to break old code.

      2. The extensions to Hashtable means that old code relying on subclassing
      Hashtable, e.g. in order to monitor changes in the table, will no longer work.
      The reason is that a number of new methods in Hashtable (like entrySet())
      modify the internal data of the Hashtable directly, rather than using the
      old API (get, put, remove, etc.).

      If subclassing of Hashtable, Properties, etc. wasn't allowed, they should
      have been final.
      (Review ID: 37603)
      ======================================================================

            jjb Josh Bloch
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: