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

Replace usage of Vectors with ArrayLists in Swing, where appropiate

    XMLWordPrintable

    Details

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

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0-rc"

      A DESCRIPTION OF THE PROBLEM :
      Swing uses Vectors where ArrayLists may be better candidates. Vector methods are synchronized, ArrayLists are not. Ive identified these candidate classes where Vector is mentioned and most likely used:
      javax/swing/AbstractButton.java
      javax/swing/ButtonGroup.java
      javax/swing/CellRendererPane.java
      javax/swing/DefaultComboBoxModel.java
      javax/swing/DefaultListModel.java
      javax/swing/JApplet.java
      javax/swing/JComboBox.java
      javax/swing/JComponent.java
      javax/swing/JDesktopPane.java
      javax/swing/JDialog.java
      javax/swing/JEditorPane.java
      javax/swing/JFileChooser.java
      javax/swing/JFrame.java
      javax/swing/JList.java
      javax/swing/JMenu.java
      javax/swing/JMenuBar.java
      javax/swing/JOptionPane.java
      javax/swing/JPopupMenu.java
      javax/swing/JRootPane.java
      javax/swing/JTabbedPane.java
      javax/swing/JTable.java
      javax/swing/JTree.java
      javax/swing/JWindow.java
      javax/swing/KeyboardManager.java
      javax/swing/MenuSelectionManager.java
      javax/swing/SwingUtilities.java
      javax/swing/SystemEventQueueUtilities.java
      javax/swing/UIDefaults.java
      javax/swing/UIManager.java
      javax/swing/#JTable.java#
      javax/swing/event/TreeModelEvent.java
      javax/swing/filechooser/FileSystemView.java
      javax/swing/plaf/basic/BasicDesktopPaneUI.java
      javax/swing/plaf/basic/BasicDirectoryModel.java
      javax/swing/plaf/basic/BasicTabbedPaneUI.java
      javax/swing/plaf/metal/MetalBumps.java
      javax/swing/plaf/metal/MetalFileChooserUI.java
      javax/swing/plaf/metal/MetalIconFactory.java
      javax/swing/plaf/multi/MultiButtonUI.java
      javax/swing/plaf/multi/MultiColorChooserUI.java
      javax/swing/plaf/multi/MultiComboBoxUI.java
      javax/swing/plaf/multi/MultiDesktopIconUI.java
      javax/swing/plaf/multi/MultiDesktopPaneUI.java
      javax/swing/plaf/multi/MultiFileChooserUI.java
      javax/swing/plaf/multi/MultiInternalFrameUI.java
      javax/swing/plaf/multi/MultiLabelUI.java
      javax/swing/plaf/multi/MultiListUI.java
      javax/swing/plaf/multi/MultiLookAndFeel.java
      javax/swing/plaf/multi/MultiMenuBarUI.java
      javax/swing/plaf/multi/MultiMenuItemUI.java
      javax/swing/plaf/multi/MultiOptionPaneUI.java
      javax/swing/plaf/multi/MultiPanelUI.java
      javax/swing/plaf/multi/MultiPopupMenuUI.java
      javax/swing/plaf/multi/MultiProgressBarUI.java
      javax/swing/plaf/multi/MultiRootPaneUI.java
      javax/swing/plaf/multi/MultiScrollBarUI.java
      javax/swing/plaf/multi/MultiScrollPaneUI.java
      javax/swing/plaf/multi/MultiSeparatorUI.java
      javax/swing/plaf/multi/MultiSliderUI.java
      javax/swing/plaf/multi/MultiSpinnerUI.java
      javax/swing/plaf/multi/MultiSplitPaneUI.java
      javax/swing/plaf/multi/MultiTabbedPaneUI.java
      javax/swing/plaf/multi/MultiTableHeaderUI.java
      javax/swing/plaf/multi/MultiTableUI.java
      javax/swing/plaf/multi/MultiTextUI.java
      javax/swing/plaf/multi/MultiToolBarUI.java
      javax/swing/plaf/multi/MultiToolTipUI.java
      javax/swing/plaf/multi/MultiTreeUI.java
      javax/swing/plaf/multi/MultiViewportUI.java
      javax/swing/plaf/synth/SynthDesktopPaneUI.java
      javax/swing/plaf/synth/SynthTabbedPaneUI.java
      javax/swing/table/DefaultTableColumnModel.java
      javax/swing/table/DefaultTableModel.java
      javax/swing/text/AbstractDocument.java
      javax/swing/text/BoxView.java
      javax/swing/text/CompositeView.java
      javax/swing/text/DefaultHighlighter.java
      javax/swing/text/DefaultStyledDocument.java
      javax/swing/text/FlowView.java
      javax/swing/text/GapContent.java
      javax/swing/text/GapVector.java
      javax/swing/text/JTextComponent.java
      javax/swing/text/LayoutQueue.java
      javax/swing/text/PlainDocument.java
      javax/swing/text/PlainView.java
      javax/swing/text/StringContent.java
      javax/swing/text/StyleContext.java
      javax/swing/text/TableView.java
      javax/swing/text/WrappedPlainView.java
      javax/swing/text/ZoneView.java
      javax/swing/text/#AbstractDocument.java#
      javax/swing/text/html/AccessibleHTML.java
      javax/swing/text/html/CSS.java
      javax/swing/text/html/HTMLDocument.java
      javax/swing/text/html/HTMLWriter.java
      javax/swing/text/html/Map.java
      javax/swing/text/html/StyleSheet.java
      javax/swing/text/html/TableView.java
      javax/swing/text/html/parser/AttributeList.java
      javax/swing/text/html/parser/ContentModel.java
      javax/swing/text/html/parser/DTD.java
      javax/swing/text/html/parser/Parser.java
      javax/swing/text/html/parser/TagStack.java
      javax/swing/text/rtf/RTFAttributes.java
      javax/swing/text/rtf/RTFGenerator.java
      javax/swing/text/rtf/RTFReader.java
      javax/swing/tree/DefaultMutableTreeNode.java
      javax/swing/tree/DefaultTreeCellEditor.java
      javax/swing/tree/DefaultTreeModel.java
      javax/swing/tree/DefaultTreeSelectionModel.java
      javax/swing/tree/TreePath.java
      javax/swing/tree/VariableHeightLayoutCache.java
      javax/swing/undo/CompoundEdit.java
      javax/swing/undo/StateEdit.java
      javax/swing/undo/UndoManager.java
      javax/swing/undo/UndoableEditSupport.java

      these classes should be audited and replace Vectors, when possible, with ArrayLists

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      read swing source, look for Vector usage

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      ArrayLists being used everywhere.
      ACTUAL -
      116 classes that appear to be using Vectors.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      read java source, see Vector usage.
      ---------- 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: