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

UIManager.getDefaults().keySet() is empty

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • client-libs
    • generic
    • solaris_2.6

      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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: