classpath
[Top][All Lists]
Advanced

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

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


From: Steven Augart
Subject: Question on java.lang.Thread and "final static int" constants
Date: Mon, 10 May 2004 12:25:24 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007

java.lang.Thread defines the integer constants MIN_PRIORITY, NORM_PRIORITY, MAX_PRIORITY.

The JDK 1.1.8 documentation simply defines them semantically, without giving numbers. The book "The Java Class Libraries Second Edition, Volume 1" explicitly defines them as 1, 5, and 10. The JDK 1.4.2 docs explicitly define them as 1, 5, and 10 in an appendix.

So, for the purposes of GNU Classpath's AWT code (--portable-native-sync), is it reasonable to assume that they are, indeed, 1, 5, and 10, or should the implementation check the values at run time and cache the results? Since the Java language spec expicitly allows the java source-to-byte-code compiler to inline the values of static final constants, presumably the values can never change in the future, without breaking Write-Once-Run-Everywhere (or perhaps it should be compile-once-run-everywhere :)).




--
Steven Augart

Jikes RVM, a free, open source, Virtual Machine:
http://oss.software.ibm.com/jikesrvm





reply via email to

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