JDK-6885752 : closed/javax/swing/JRootPane/4627806/bug4627806.java fails
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2009-09-25
  • Updated: 2011-01-19
  • Resolved: 2010-06-30
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Description
The test fails with the latest JDK 7b72. Tested on linux-i586. Probably may fail on other platforms as well. The execution output:

----------System.err:(30/2028)----------
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
	at java.lang.String.charAt(String.java:694)
	at sun.swing.SwingUtilities2.getLeftSideBearing(SwingUtilities2.java:248)
	at sun.swing.MenuItemLayoutHelper.getLeftExtraWidth(MenuItemLayoutHelper.java:162)
	at sun.swing.MenuItemLayoutHelper.calcExtraWidths(MenuItemLayoutHelper.java:158)
	at sun.swing.MenuItemLayoutHelper.reset(MenuItemLayoutHelper.java:148)
	at sun.swing.MenuItemLayoutHelper.<init>(MenuItemLayoutHelper.java:107)
	at javax.swing.plaf.basic.BasicMenuItemUI.getPreferredMenuItemSize(BasicMenuItemUI.java:408)
	at javax.swing.plaf.basic.BasicMenuItemUI.getPreferredSize(BasicMenuItemUI.java:363)
	at javax.swing.JComponent.getPreferredSize(JComponent.java:1650)
	at java.awt.FlowLayout.preferredLayoutSize(FlowLayout.java:414)
	at java.awt.Container.preferredSize(Container.java:1644)
	at java.awt.Container.getPreferredSize(Container.java:1629)
	at javax.swing.JComponent.getPreferredSize(JComponent.java:1652)
	at java.awt.BorderLayout.preferredLayoutSize(BorderLayout.java:719)
	at java.awt.Container.preferredSize(Container.java:1644)
	at java.awt.Container.getPreferredSize(Container.java:1629)
	at javax.swing.JComponent.getPreferredSize(JComponent.java:1652)
	at javax.swing.JRootPane$RootLayout.preferredLayoutSize(JRootPane.java:915)
	at java.awt.Container.preferredSize(Container.java:1644)
	at java.awt.Container.getPreferredSize(Container.java:1629)
	at javax.swing.JComponent.getPreferredSize(JComponent.java:1652)
	at java.awt.BorderLayout.preferredLayoutSize(BorderLayout.java:719)
	at java.awt.Container.preferredSize(Container.java:1644)
	at java.awt.Container.getPreferredSize(Container.java:1629)
	at java.awt.Window.pack(Window.java:762)
	at bug4627806.init(bug4627806.java:20)
	at com.sun.javatest.regtest.AppletWrapper$AppletThread.run(AppletWrapper.java:144)
	at java.lang.Thread.run(Thread.java:717)
STATUS:Failed.Applet thread threw exception: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
result: Failed. Execution failed: Applet thread threw exception: java.lang.StringIndexOutOfBoundsException: String index out of range: 0