JDK-4959409 : REGRESSION: JCK1.5 api/javax_swing/interactive/JMenuItemTests.html#JMenuItem
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt:i18n
  • Affected Version: 5.0
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_8,solaris_10
  • CPU: x86,sparc
  • Submitted: 2003-11-25
  • Updated: 2004-01-07
  • Resolved: 2003-12-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b32Fixed
Related Reports
Relates :  
Description

Name: iaR10016			Date: 11/25/2003


Filed By      : J2SE-SQA [###@###.###
JDK           : JDK1.5.0-b29
                 (not reproducible with JDK1.5.0-b28, JDK1.4.2-b28)
JCK           : JCK1.5-runtime (b08)
Platform[s]   : Solaris sparc, Solaris x86
                 (tested on Solaris 10 sparc/GNOME2, Solaris 9 sparc/CDE,
                  Solaris 9 x86/CDE, Solaris 8 x86/OpenWin)
                 not reproducible on Linux and Windows systems
switch/Mode   : default
JCK test owner: http://javaweb.eng/jck/usr/owners.jto
Falling test  : api/javax_swing/interactive/JMenuItemTests.html#JMenuItem[JMenuItemTest0004]

JCK1.5-runtime api/javax_swing/interactive/JMenuItemTests.html#JMenuItem[JMenuItemTest0004]
test fails with JDK1.5.0-b29 on Solaris systems.

Please, run the script from "How to reproduce" section to reproduce the failure.

Testcase JMenuItemTest0004 Description reads:
...
This test veirifies the behavior of setAccelerator(KeyStroke).
Please verify that the panel below has a menubar with one menu and 4 items in it.
Besides using the mouse to maneuver and select the menu items, they can also be
selected by holding down the Meta-key/ALT and pressing 'm' to bring up the menu
and follow by pressing 'Shift'+'1/2/3/4' to select the menu item.
The menu item selection status is reflected into the corresponding radio button.
...

Alt+'m' pressing correctly bring up the menu, however, Shift+'1/2/3/4' pressing does not
select corresponding menu item.

This failure is not reproducible with previous JDK builds.

Test source location:
=====================
/java/re/jck/1.5/promoted/latest/binaries/JCK-runtime-15/tests/api/javax_swing/interactive/JMenuItemTests.java

jtr file location:
==================
/net/jtgb4u4c.sfbay/export/sail15/results.2/tiger/b29/jck15/sparc/sol10_sparc_gnome_plugin_mz1.2_linux-8/workDir/api-interactive/javax_swing/interactive/JMenuItemTests_JMenuItem.jtr

How to reproduce:
=================
Run the following script (you may need to change its variables)

--- script start ---
#!/bin/bash

#Paths in Java Software:
JDK="/java/re/jdk/1.5.0/promoted/all/b29/binaries/solaris-sparc"
JCK="/java/re/jck/1.5/promoted/beta/b08/binaries/JCK-runtime-15"

#Alternative paths outside Java Software:
#JDK="/net/koori.sfbay/onestop/jdk/1.5.0/promoted/all/b29/binaries/solaris-sparc"
#JCK="/net/koori.sfbay/onestop/jck/1.5/promoted/beta/b08/binaries/JCK-runtime-15"

export CLASSPATH="$JCK/classes:$JCK/lib/javatest.jar"
$JDK/bin/java javasoft.sqe.tests.api.javax.swing.interactive.JMenuItem.JMenuItemTests -TestCaseID JMenuItemTest0004                -TestDirURL file://$JCK/tests/api/javax_swing/interactive/JMenuItemTests.html#JMenuItem
--- script end ---

Specific machine info:
======================
Hostname: linux-8
OS: Solaris 10 (sparc) (Gnome2)

======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta FIXED IN: tiger-beta INTEGRATED IN: tiger-b32 tiger-beta VERIFIED IN: tiger-beta
14-06-2004

EVALUATION Name: azR10139 Date: 11/26/2003 After some investigation i found that there are a problem with the keyboard events. Below is the simple AWT testcase which demonstrates the problem. To reproduce this just compile and run it. When focus is on the button, try to type <Shift>+'1' combination. On build 29 the keyPressed event will not reach the listener. On build 28 both events are being dispatched to the listener, but if you decomment the lines where this listener is being added as key event post processor you will see that the press event for all the <Shifn>+number combinations never being passed to the postprocessor, only the release event did. And this is happened with all the 1.5.0 builds and even with the JDK 1.4.2. This is the reason why such an accelerators do not works on b29. Changing subcategory to classes_awt. ###@###.### 11/26/2003 -- Test.java -- import java.awt.event.*; import java.awt.*; public class Test { public static class KeyWatcher extends KeyAdapter implements KeyEventPostProcessor { public void keyPressed(KeyEvent ev) { String code = KeyEvent.getKeyText(ev.getKeyCode()); String mods = KeyEvent.getKeyModifiersText(ev.getModifiers()); System.out.println("Pressed: "+mods+"+"+code); System.out.println("Consumed? "+ev.isConsumed()); } public void keyReleased(KeyEvent ev) { String code = KeyEvent.getKeyText(ev.getKeyCode()); String mods = KeyEvent.getKeyModifiersText(ev.getModifiers()); System.out.println("Released: "+mods+"+"+code); System.out.println("Consumed? "+ev.isConsumed()); } public void keyTyped(KeyEvent ev) {} // do nothing public boolean postProcessKeyEvent(KeyEvent ev) { if(ev.getID() != KeyEvent.KEY_PRESSED && ev.getID() != KeyEvent.KEY_RELEASED) { // Watch only for press and release events return false; } String code = KeyEvent.getKeyText(ev.getKeyCode()); String mods = KeyEvent.getKeyModifiersText(ev.getModifiers()); String pressed = (ev.getID() == KeyEvent.KEY_PRESSED? "Pressed: " : "Released: "); System.out.println(pressed+mods+"+"+code); System.out.println("Consumed? "+ev.isConsumed()); return false; } } public static void main(String args[]) { Frame frame = new Frame("Frame to test mnemonics and accelerators"); frame.setSize(200, 200); Button jb = new Button("Able to press, able not to press"); jb.addKeyListener(new KeyWatcher()); frame.add(jb); /* KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager(); kfm.addKeyEventPostProcessor(new KeyWatcher()); */ frame.setVisible(true); } } -- Test.java -- ====================================================================== AWT did not integrate into build 29. The only putback that looks at all related to client code is i18n. I wonder if this could have something to do with the fix for 4490692? We should probably verify whether this bug really is new in build29. ###@###.### 2003-11-26 Name: ssR10077 Date: 11/27/2003 This bug is a regression caused by the fix 4490692. Rolling back the following delta removes the problem awt_InputMethod.c D 1.65 03/11/10 14:14:24 naoto Fixed 4490692: Lightweight component receives incorrect KeyEvents for accented keys The issue with KeyboardFocusManager postProcessor is a separate problem and is unrelated to the original bug description. ====================================================================== Looks like this is a regression caused by the fix for 4490692. ###@###.### 2003-12-01 When the "Shift+1" combination is pressed, the code path is incorrectly led to the input method path due to the fix for 4490692. This results in only generationg KeyTyped event for that key. ###@###.### 2003-12-02
02-12-2003