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

Replace usage of Stack with ArrayDeque in Swing, when appropiate

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.6.0-rc"

      A DESCRIPTION OF THE PROBLEM :
      Stack should be replaced with ArrayDeque where it appropiate. It offers more flexibility in the interface and its methods are unsynchronized which should provied improved performance. Ive identified these classes as potential users of Stack:
      /javax/swing/ActionMap.java
      /javax/swing/InputMap.java
      /javax/swing/JComponent.java
      /javax/swing/JEditorPane.java
      /javax/swing/JMenu.java
      /javax/swing/JRootPane.java
      /javax/swing/JTree.java
      /javax/swing/KeyboardManager.java
      /javax/swing/MenuSelectionManager.java
      /javax/swing/SwingUtilities.java
      /javax/swing/SystemEventQueueUtilities.java
      /javax/swing/UIDefaults.java
      /javax/swing/filechooser/FileSystemView.java
      /javax/swing/plaf/basic/BasicLookAndFeel.java
      /javax/swing/plaf/basic/BasicMenuItemUI.java
      /javax/swing/text/DefaultCaret.java
      /javax/swing/text/DefaultStyledDocument.java
      /javax/swing/text/ElementIterator.java
      /javax/swing/text/StyleContext.java
      /javax/swing/text/html/CSS.java
      /javax/swing/text/html/CSSParser.java
      /javax/swing/text/html/FrameView.java
      /javax/swing/text/html/HTMLDocument.java
      /javax/swing/text/html/HTMLWriter.java
      /javax/swing/text/html/StyleSheet.java
      /javax/swing/text/html/parser/Parser.java
      /javax/swing/text/html/parser/TagStack.java
      /javax/swing/text/rtf/RTFGenerator.java
      /javax/swing/tree/DefaultMutableTreeNode.java
      /javax/swing/tree/FixedHeightLayoutCache.java
      /javax/swing/tree/VariableHeightLayoutCache.java

      they should be audited and have their Stacks replaced with ArrayDeques.

      REGRESSION. Last worked in version mustang

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      read the source, their using the Stack

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      ArrayDeques being used.
      ACTUAL -
      Stacks everywhere!

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      read the source, their there.
      ---------- END SOURCE ----------

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: