RFR: 8072645: java.util.logging should use java.time to get more precise time stamps

Peter Levart peter.levart at gmail.com
Sat Feb 14 17:23:40 UTC 2015


On 02/14/2015 04:33 PM, Peter Levart wrote:
> Well, internally I think it should be stored as an Instant. So you 
> don't have to reconstruct Instant objects at each call to 
> getInstant(). Serialization of LogRecord is not a frequent 
> requirement, so the overhead should be moved to it, rather than to 
> frequent code-paths. That's my opinion.
>
> Documenting serializable format should be easy anyway. It doesn't have 
> to be based directly on public getters/setters. For example:
>
> The LogRecord's "instant" is serialized as two hypothetical fields to 
> keep backwards compatibility:
>
> long millis = getInstant().toEpochMilli();
>
> int nanoOfMilli = getInstant().getNano() % 1000_000;
>
>
> Regards, Peter

Hi Daniel,

I must admit, it's not so simple after all. I tried to do it and I had 
to do the following to get a decent javadoc:

http://cr.openjdk.java.net/~plevart/jdk9-dev/LogRecord.instant/webrev.01/


So take it if you think this isn't too much to support or leave it and 
do it your way (with just an additional @serial nanoAdjustment field).


Regards, Peter




More information about the core-libs-dev mailing list