<i18n dev> <AWT Dev> [8] Review request for 6789984: JPasswordField can not receive keyboard input

Anton Litvinov anton.litvinov at oracle.com
Fri Nov 2 09:24:37 PDT 2012

Hello Anthony,

Thank you for the review of this fix. I ran only automatic tests, which 
are located in the specified below directories, but on my local Linux 


No, unfortunately, by the current moment I have not run the tests on 
other operating systems yet, but of course I am able to do this at least 
on Windows and Solaris OS and also to try to include manual tests in a 
selection list.

The comment explaining the root cause of the issue with the proposed 
solution was added to the bug's page, but it is not updated yet, 
therefore it is provided below. Also it was found out that this bug can 
be reproduced also on Ubuntu 12.04 amd64 OS. The only requirement to a 
proper environment is presence of the package "scim-anthy" with its all 
dependent packages in the system.

The comment:

    Information Concerning a Cause of the Bug:
    A cause of this bug is the fact that a native Input Method (IM)
    Engine, in current case SCIM, continues consumption or filtering of
    keyboard events during a call to:
         XlibWrapper.XFilterEvent(ev.getPData(), w)
    in “public void run(boolean loop)” method of “sun.awt.X11.XToolkit”,
    after it is disabled by a call to:
    in “void dispatchEventImpl(AWTEvent e)“ method of
    “java.awt.Component”. By filtering the keyboard events SCIM prevents
    them from being dispatched further to AWT event handlers, what
    finally leads to not reception of any keyboard events by a Component
    with disabled IMs like JPasswordField.

    I suppose that a root cause of inability to completely disable IM
    with help of
         public abstract void disableInputMethod()
    method of “sun.awt.im.InputMethodAdapter” is lack of calls to
    XUnsetICFocus() native function for active and passive input
    contexts in a low level processing inside the procedure
    “setXICFocusNative” of
    “jdk/src/solaris/native/sun/awt/awt_InputMethod.c”, which is
    expected to perform the disabling function. When current input
    context is disabled, there are still not disabled active and passive
    input contexts on a low level of native code.

    Found Solution:
    As a solution for this bug I consider inclusion of code disabling
    active and passive input contexts by means of call to
         protected native String resetXIC()
    method of “sun.awt.X11InputMethod” into the earlier mentioned
    “disableInputMethod” method of “sun.awt.im.InputMethodAdapter”

Thank you,

On 11/2/2012 4:43 PM, Anthony Petrov wrote:
> Hi Anton,
> I'm not an expert in IM code, but generally the changes look good to 
> me. I'm also CC'ing i18n-dev@ to take a look at this fix.
> My only concern is that you're changing shared code here. Did you run 
> any IM tests on other platforms to make sure no regressions are 
> introduced?
> Also, could you please add a comment to the bug report explaining the 
> root cause of the issue and how the proposed solution helps resolve it?
> -- 
> best regards,
> Anthony
> On 11/1/2012 8:40 PM, Anton Litvinov wrote:
>> Hello,
>> Please review the following fix for a bug.
>> Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6789984
>> Webrev: http://cr.openjdk.java.net/~alitvinov/6789984/webrev.00
>> This bug consists in inability of JPasswordField to react on any 
>> keyboard events under certain conditions on Linux OS. The webrev does 
>> not contain any new "jtreg" test, because a particular Linux OS 
>> distribution with additionally installed packages are required for 
>> reproduction of the bug.
>> Requirements to the environment:
>> 1. Oracle Enterprise Linux (OEL) 5.6 x86 64/Oracle Enterprise Linux 
>> (OEL) 5.5 x86 64
>> 2. Package "scim-anthy-1.2.0-6.el5.x86_64" and its all dependent 
>> packages installed on the OS.
>> 3. JDK 8.
>> 4. A simple Java Swing application, where a dialog with both 
>> JTextField and JPasswordField is displayed.
>> Thank you,
>> Anton

More information about the i18n-dev mailing list