This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

java.util.Timer not handling negative System.currentTimeMillis()


Hi there,

I just encountered a funny (initially strange) problem arising because my embedded RT-Clock was set to the year 1909.
Hence System.currentTimeMillis() returns a negative number, and this is used internally in java.util.Timer#schedule(), and throws an unchecked exception - aarghh...


I know this is an obscure problem, but is there is requirement that we are only "allowed" to run gcj on targets with clocks > 1970.
One could change the Timer code to handle this situation, or just ignore it.


For now I will just make sure the time is not less than 1970 and larger than some other limit overflowing the long.

The problem arises because my target's RTC comes with an undefinded initial time - hence anything is possible :-)

// Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]