classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question on java.lang.Thread and "final static int" constants


From: C. Brian Jones
Subject: Re: Question on java.lang.Thread and "final static int" constants
Date: Tue, 11 May 2004 23:24:17 -0400

On Mon, 2004-05-10 at 12:46, Tom Tromey wrote:
> >>>>> "Steven" == Steven Augart <address@hidden> writes:
> 
> Steven> So, for the purposes of GNU Classpath's AWT code
> Steven> (--portable-native-sync), is it reasonable to assume that they are,
> Steven> indeed, 1, 5, and 10, or should the implementation check the values at
> Steven> run time and cache the results?  Since the Java language spec
> Steven> expicitly allows the java source-to-byte-code compiler to inline the
> Steven> values of static final constants, presumably the values can never
> Steven> change in the future
> 
> Yeah, in theory the values can't change.  In practice, Sun has broken
> this once or twice in the past, though honestly I doubt they would
> bother changing these particular values.
> 
> I'd say in a case like this you can do whatever you like, provided the
> result is documented.

There is precedent for native code to simply #define these constants to
avoid expensive lookups so feel free to do the same here.  Could
probably add it to the cp-tools version of javap even if it isn't there.

Brian

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]