What the Duration of negative Infinity mean?

Martin Sladecek martin.sladecek at oracle.com
Thu Jan 31 00:12:59 PST 2013

Is there a reason why we support negative values in Duration at all? 
Maybe we should throw IllegalArgumentException when some negative value 
is set in one of the factory methods.


On 01/31/2013 12:22 AM, Richard Bair wrote:
> http://javafx-jira.kenai.com/browse/RT-23951
> I recently added to ScheduledService, and it supported all the boundary conditions (isIndefinite, isUnknown) of a Duration. Right now NEGATIVE_INFINITY is not handled at all in Duration. POSITIVE_INFINITY maps to isIndefinite and NaN maps to isUnknown.
> It seems like NEGATIVE_INFINITY should also cause isIndefinite to return true. Some code (including mine) was assuming isIndefinite was positive, but that would not now necessarily be the case.
> Thoughts?
> Richard

More information about the openjfx-dev mailing list