harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Zakharov" <alexei.zakha...@gmail.com>
Subject [drlvm] “java.compiler” property
Date Fri, 13 Oct 2006 12:55:15 GMT
Hi all,

I found that we have some problems with system properties in DRLVM. In
the javadoc for java.lang.System class the particular list of
mandatory properties that should be returned by the getProperties()
method is described. However, DRLVM does not provide the value for the
mandatory "java.compiler" property. This leads to some problems
including the test failure from the java.lang.management test suite
(HY-1407). This problem was mentioned by Andrey Yakushev [1].  Below
is the small test that checks all mandatory properties:

<--
import java.util.*;

public class TestVMProps {

    static String[] mandatoryProps = new String[] {
            "java.version",
            "java.vendor",
            "java.vendor.url",
            "java.home",
            "java.vm.specification.version",
            "java.vm.specification.vendor",
            "java.vm.specification.name",
            "java.vm.version",
            "java.vm.vendor",
            "java.vm.name",
            "java.specification.version",
            "java.specification.vendor",
            "java.specification.name",
            "java.class.version",
            "java.class.path",
            "java.library.path",
            "java.io.tmpdir",
            "java.compiler",
            "java.ext.dirs",
            "os.name",
            "os.arch",
            "os.version",
            "file.separator",
            "path.separator",
            "line.separator",
            "user.name",
            "user.home",
            "user.dir"
    };

    public static void main(String argv[]) {
         Vector<String> missed = new Vector<String>();
         Properties props = System.getProperties();

         for (String mandProp: mandatoryProps) {
             boolean found = false;
             Enumeration<String> propEnum = (Enumeration<String>)
                     props.propertyNames();

             while (propEnum.hasMoreElements()) {
                 String prop = propEnum.nextElement();

                 if (mandProp.equals(prop)) {
                     found = true;
                     break;
                 }
             }

             if (!found) {
                 missed.add(mandProp);
             }
         }

         System.out.println("Number of missed props: " + missed.size());
         System.out.println("Missed props: " + missed);
    }
}
<--

If invoked on DRLVM:
C:\mydoc\projects\tests>C:\Java\harmony-hdk-r450941\jdk\jre\bin\java.exe
TestVMProps
Number of missed props: 1
Missed props: [java.compiler]

On IBM VME:
C:\mydoc\projects\tests>C:\Java\harmony-bin\bin\java.exe TestVMProps
Number of missed props: 0
Missed props: []

On RI:
C:\mydoc\projects\tests>C:\Java\jdk1.5.0\bin\java.exe TestVMProps
Number of missed props: 1
Missed props: [java.compiler]

You may notice that RI also does not provide the value for
"java.compiler".  BTW, we have a test in the DRLVM test suite that
should check all mandatory properties –
java.lang.SystemExtensionTest.test_getProperty_Str(). But it seems the
author of the test makes a muddle of logical operators – puts OR
instead of AND. So the test now checks if at least one of mandatory
property is set.

IMHO we should return something for the "java.compiler" property name.
Any thoughts?

[1] http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200610.mbox/%3c3c7e1c080610050500i60a414bgfd2df69003e4e429@mail.gmail.com%3e
(problem 2)

Thanks,

-- 
Alexei Zakharov,
Intel Enterprise Solutions Software Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message