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

UIManager.getDefaults().keySet() is empty

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      solaris_2.6

      Description

      The collection provided via UIManager.getDefaults() does not correctly implement the Hashtable API, providing an empty keySet() rather than the correct collection of key values.

      The following code snippet clearly reports hundreds of elements in the defaults table, but zero keys in the key set ...

      import java.awt.*;
      import javax.swing.*;

      class uimgr {
          public static void main(String [] args) {
               UIDefaults defaults = UIManager.getDefaults();
               System.out.println(defaults.size());
               System.out.println(defaults.keySet().size());
          }
      }
      bash-2.00$ /java/re/jdk/1.5.0/latest/binaries/solaris-sparc/bin/java uimgr
      615
      0

      Bug WorkaroundUsing the Enumerator interface via UIManager.getDefaults.keys() works correctly

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                trebari Tejpal Rebari
                Reporter:
                ksoshals Kirill Soshalskiy (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: