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

Replace Hashtable usage in Swing with HashMaps, where appropiate

    XMLWordPrintable

    Details

    • Subcomponent:
    • Understanding:
      Cause Known
    • CPU:
      x86
    • OS:
      solaris_10

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0-rc"


      A DESCRIPTION OF THE PROBLEM :
      I have identified these classes that at the minumum mention Hashtable in their implementation:
      javax/swing/AbstractAction.java
      javax/swing/ArrayTable.java
      javax/swing/DebugGraphicsInfo.java
      javax/swing/JComponent.java
      javax/swing/JEditorPane.java
      javax/swing/JLayeredPane.java
      javax/swing/JMenu.java
      javax/swing/JPopupMenu.java
      javax/swing/JSlider.java
      javax/swing/JTable.java
      javax/swing/JToolBar.java
      javax/swing/JTree.java
      javax/swing/KeyboardManager.java
      javax/swing/SwingUtilities.java
      javax/swing/SystemEventQueueUtilities.java
      javax/swing/UIDefaults.java
      javax/swing/UIManager.java
      javax/swing/plaf/basic/BasicFileChooserUI.java
      javax/swing/plaf/basic/BasicTabbedPaneUI.java
      javax/swing/plaf/basic/BasicTableUI.java
      javax/swing/plaf/basic/BasicTextUI.java
      javax/swing/plaf/basic/BasicToolBarUI.java
      javax/swing/plaf/basic/BasicTreeUI.java
      javax/swing/plaf/synth/SynthTabbedPaneUI.java
      javax/swing/text/AbstractDocument.java
      javax/swing/text/DefaultStyledDocument.java
      javax/swing//text/JTextComponent.java
      javax/swing/text/SimpleAttributeSet.java
      javax/swing/text/Style.java
      javax/swing/text/StyleContext.java
      javax/swing/text/TextAction.java
      javax/swing/text/TextLayoutStrategy.java
      javax/swing/text/html/AccessibleHTML.java
      javax/swing/text/html/CSS.java
      javax/swing/text/html/HTML.java
      javax/swing/text/html/HTMLDocument.java
      javax/swing/text/html/MinimalHTMLWriter.java
      javax/swing/text/html/StyleSheet.java
      javax/swing/text/html/parser/AttributeList.java
      javax/swing/text/html/parser/DTD.java
      javax/swing/text/html/parser/Element.java
      javax/swing/text/html/parser/Entity.java
      javax/swing/text/html/parser/Parser.java
      javax/swing/text/rtf/RTFAttributes.java
      javax/swing/text/rtf/RTFGenerator.java
      javax/swing/text/rtf/RTFReader.java
      javax/swing/tree/DefaultTreeSelectionModel.java
      javax/swing/tree/FixedHeightLayoutCache.java
      javax/swing/tree/VariableHeightLayoutCache.java
      javax/swing/undo/StateEdit.java
      javax/swing/undo/StateEditable.java

      Some like AbstractAction import Hashtable but do not use it. Others like ArrayTable use a Hashtable for its storage.

      The reason to convert would be to remove unnecessary synchronization. Hashtable's methods are synchronized, HashMaps are not.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      read source, find usage

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      use HashMaps instead of Hashtables
      ACTUAL -
      Hashtables, everywhere!

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      read java source, their there
      ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              ndcosta Nelson Dcosta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Imported:
                Indexed: