-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.2.0
-
generic
-
generic
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)
======================================================================
- relates to
-
JDK-8157123 java.util.Properties class is violating the Liskov's Substitution Principle (LSP)
-
- Closed
-
-
JDK-4061282 Properties class does not 'force' String objects
-
- Closed
-