JDK-6960516 : sun.awt.UngrabEvent has an ID over AWTEvent.RESERVED_ID_MAX
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u20
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2010-06-11
  • Updated: 2011-03-16
  • Resolved: 2011-03-02
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.
JDK 6 JDK 7
6u24-rev b23Fixed 7Fixed
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
04-12-2010

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.
16-06-2010

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

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