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

Remove synchronized keyword from method declarations in Swing

    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 :
      There are classes in Swing whose method's declaration includes the synchronization keyword. Given that Swing is single threaded these methods should have the synchronization keyword removed.

      The following classes are potential candidates:
      javax/swing/AbstractAction.java
      javax/swing/ActionPropertyChangeListener.java
      javax/swing/BoxLayout.java
      javax/swing/BufferStrategyPaintManager.java
      javax/swing/DebugGraphicsObserver.java
      javax/swing/GroupLayout.java
      javax/swing/ImageIcon.java
      javax/swing/JApplet.java
      javax/swing/JCheckBoxMenuItem.java
      javax/swing/JComponent.java
      javax/swing/JEditorPane.java
      javax/swing/JInternalFrame.java
      javax/swing/JLayeredPane.java
      javax/swing/JTabbedPane.java
      javax/swing/JTable.java
      javax/swing/JTextField.java
      javax/swing/KeyStroke.java
      javax/swing/LayoutStyle.java
      javax/swing/MenuSelectionManager.java
      javax/swing/MultiUIDefaults.java
      javax/swing/PopupFactory.java
      javax/swing/ProgressMonitorInputStream.java
      javax/swing/RepaintManager.java
      javax/swing/SwingUtilities.java
      javax/swing/Timer.java
      javax/swing/SwingWorker.java
      javax/swing/SystemEventQueueUtilities.java
      javax/swing/TimerQueue.java
      javax/swing/TransferHandler.java
      javax/swing/UIDefaults.java
      javax/swing/UIManager.java
      javax/swing/event/EventListenerList.java
      javax/swing/colorchooser/DefaultHSBChooserPanel.java
      javax/swing/colorchooser/SyntheticImage.java
      javax/swing/plaf/basic/BasicDirectoryModel.java
      javax/swing/plaf/basic/BasicLookAndFeel.java
      javax/swing/plaf/basic/BasicPopupMenuUI.java
      javax/swing/plaf/basic/BasicRadioButtonUI.java
      javax/swing/plaf/basic/BasicSliderUI.java
      javax/swing/plaf/basic/BasicTextUI.java
      javax/swing/plaf/metal/MetalLookAndFeel.java
      javax/swing/plaf/metal/MetalRadioButtonUI.java
      javax/swing/plaf/metal/MetalToolBarUI.java
      javax/swing/plaf/metal/MetalUtils.java
      javax/swing/plaf/synth/ColorType.java
      javax/swing/plaf/synth/DefaultSynthStyleFactory.java
      javax/swing/plaf/synth/ImagePainter.java
      javax/swing/plaf/synth/Region.java
      javax/swing/plaf/synth/SynthStyle.java
      javax/swing/plaf/synth/SynthContext.java
      javax/swing/plaf/synth/SynthGraphicsUtils.java
      javax/swing/plaf/synth/SynthLookAndFeel.java
      javax/swing/table/TableColumn.java
      javax/swing/text/AbstractDocument.java
      javax/swing/text/AsyncBoxView.java
      javax/swing/text/DefaultCaret.java
      javax/swing/text/DefaultHighlighter.java
      javax/swing/text/DefaultStyledDocument.java
      javax/swing/text/ElementIterator.java
      javax/swing/text/JTextComponent.java
      javax/swing/text/LayoutQueue.java
      javax/swing/text/SegmentCache.java
      javax/swing/text/StringContent.java
      javax/swing/text/StyleContext.java
      javax/swing/text/#AbstractDocument.java#
      javax/swing/text/html/CSS.java
      javax/swing/text/html/ImageView.java
      javax/swing/text/html/MuxingAttributeSet.java
      javax/swing/text/html/StyleSheet.java
      javax/swing/text/html/parser/Parser.java
      javax/swing/text/html/parser/ParserDelegator.java
      javax/swing/tree/DefaultTreeSelectionModel.java
      javax/swing/undo/UndoManager.java
      javax/swing/undo/UndoableEditSupport.java

      some of these classes use synchronized internal to a method, others use them in the method declaration. Given that the keyword is an implementation detail, it should not be a backwards incompatibility to remove their usage.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      read the source, its used

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      methods without the synchronization keyword used.
      ACTUAL -
      synchronization used

      REPRODUCIBILITY :
      This bug can be reproduced always.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            igor Igor Nekrestyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Imported:
              Indexed: