United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6960516 sun.awt.UngrabEvent has an ID over AWTEvent.RESERVED_ID_MAX
6960516 : sun.awt.UngrabEvent has an ID over AWTEvent.RESERVED_ID_MAX

Details
Type:
Bug
Submit Date:
2010-06-11
Status:
Resolved
Updated Date:
2011-03-16
Project Name:
JDK
Resolved Date:
2011-03-02
Component:
client-libs
OS:
solaris_10
Sub-Component:
java.awt
CPU:
sparc
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u20
Fixed Versions:
6u24-rev

Related Reports
Backport:
Backport:

Sub Tasks

Description
According to the java.awt.AWTEvent source code and documentation, the maximum value for reserved AWT event IDs is RESERVED_ID_MAX that is equals to 1999.

But sun.awt.UngrabEvent has an ID of 65535.
It prevents relying on the RESERVED_ID_MAX to perform events filtering.

Documentation should be changed to make aware of this exception 
or 
UngrabEvent ID should be changed to a value below RESERVED_ID_MAX.

The testcase attached shows that a none user-defined AWT event with an ID over RESERVED_ID_MAX is called.
To reproduce, compile and execute the attached source code
% java MyCancas
Open the JCombobox and keep it opened
Then click outside the main JFrame and you will see that UngrabEvent is called.

                                    

Comments
EVALUATION

http://hg.openjdk.java.net/jdk7/build/jdk/rev/8e4806e40a25
                                     
2010-12-04
SUGGESTED FIX

It might be to change the UngrubEvent ID would be better than fixing the documentation.
                                     
2010-06-16
EVALUATION

The problem here has two possible consequences.

- the described by th subitter
- someone can define a custom event with the same id as UngrubEvent

In both cases  the issues have solutions.

But despite of that we should fix the problem.
                                     
2010-06-16
WORK AROUND

In case of the submitted application the event could be filtered not only with RESERVED_ID_MAX, but with UngrubEvent id.
                                     
2010-06-16



Hardware and Software, Engineered to Work Together