This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Problem with system properties
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- To: java at gcc dot gnu dot org
- Cc: classpath at gnu dot org
- Date: Fri, 21 Jun 2002 14:21:36 +1200
- Subject: Problem with system properties
Compare the output of this test case using the current GCC/classpath
compared with GCC 3.1 or the JDK:
public class PropTest
{
public static void main(String[] args)
{
System.out.println (System.getProperties());
}
}
The problem (introduced into GCJ by a classpath merge) makes it
impossible to get a list of all the system properties which are defined,
because the "real" system properties are now just default properties for
the properties object that is returned by System.getProperties()
While looking for a fix, I wonder why system property initialization was
moved from System to Runtime. The comments mention something about VM
bootstrapping, but I don't understand why it makes a difference in this
case - System.<clinit> calls loadLibrary which will cause Runtime to be
initialized anyway, so property initialization occurs at basically the
same time. It would make more sense to me to keep the properties init
code in System. Comments?
regards
Bryce.