-
Enhancement
-
Resolution: Fixed
-
P3
-
1.4.0
-
None
-
beta
-
sparc
-
solaris_7
The javax.print API organizes printing attributes into sets which
have domain specific semantics. The API as it
stands provides an implementation which extends HashMap.
this leads to much re-specification of the methods of HashMap
in the subclass to the narrower and different needs of the printing
API.
The API would be smaller and simpler if we use HashMap internally
rather than extending it. This would also neatly avoid a bug in
HashMap which breaks subclassers which depend on Serialization.
This proposed change impacts a number of classes as there are
several extenders of the API classes which use Map & HashMap.
The proposal is that
- interface Attributeset no longer extend Map.
- class HashAttributeSet no longer extend HashMap.
- operations on unmodifiable sets which may throw an
UnsupportedOperationException throw a more specific (but still
runtime) exception
- remove methods which are on AttributeSet and its implementations
which are unused by printing and were there solely to satisfy the
Map interface be removed.
It appears that these changes have minimal impact. All existing
tests execute properly without change. The vast majority of the
changes needed are javadoc comments which are now mostly simpler
as they no longer need to explain how the contract of HashMap is
modified in this context.
have domain specific semantics. The API as it
stands provides an implementation which extends HashMap.
this leads to much re-specification of the methods of HashMap
in the subclass to the narrower and different needs of the printing
API.
The API would be smaller and simpler if we use HashMap internally
rather than extending it. This would also neatly avoid a bug in
HashMap which breaks subclassers which depend on Serialization.
This proposed change impacts a number of classes as there are
several extenders of the API classes which use Map & HashMap.
The proposal is that
- interface Attributeset no longer extend Map.
- class HashAttributeSet no longer extend HashMap.
- operations on unmodifiable sets which may throw an
UnsupportedOperationException throw a more specific (but still
runtime) exception
- remove methods which are on AttributeSet and its implementations
which are unused by printing and were there solely to satisfy the
Map interface be removed.
It appears that these changes have minimal impact. All existing
tests execute properly without change. The vast majority of the
changes needed are javadoc comments which are now mostly simpler
as they no longer need to explain how the contract of HashMap is
modified in this context.