JDK-6207371 : InputEvent.getWhen() (and similar) does not specify timebase of timestamp
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-12-10
  • Updated: 2011-01-19
  • Resolved: 2009-05-06
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 7
7 b28Fixed
Related Reports
Relates :  
Description
Methods such has InputEvent.getWhen() do not define the timebase for the timestamp that is returned.  These should probably refer to System.currentTimeMillis().

The affected APIs are (at least):
	ActionEvent.getWhen()
	InputEvent.getWhen()
	InputMethodEvent.getWhen()
	InvocationEvent.getWhen()
As well as corresponding constructors for each class that take a 'when' param.

Please see suggested fix.

###@###.### 2004-12-10 23:49:16 GMT

Comments
EVALUATION It's hard to describe what "the time of the event" means. Is it time when this event occured, created, dispatched or anything else? currentTimeMillis() usage in getWhen() method should be discussed more deeply but anyway, the reasons for this change must be strong enough to introduce backward incompatibility since the behaviour of every event will change significantly. Also there is a short discussion about getWhen() in #4976596. ###@###.### 2004-12-14 08:02:16 GMT
10-12-2004

SUGGESTED FIX "The timestamp is the difference, measured in milliseconds, between the time of the event and midnight, January 1, 1970 UTC (similar to {@link java.lang.System.currentTimeMillis})." ###@###.### 2004-12-10 23:49:16 GMT
10-12-2004