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

javax.print AttributeSet needs simplification.

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • client-libs
    • None
    • 2d
    • 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.

            prr Philip Race
            prr Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: