DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21761>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21761

[lang] SystemUtils.IS_OS_*, IS_JAVA_* always returns false.

           Summary: [lang] SystemUtils.IS_OS_*, IS_JAVA_* always returns
                    false.
           Product: Commons
           Version: Nightly Builds
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Lang
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


SystemUtils.IS_OS_*, IS_JAVA_* always returns false.

This case is on Mac OS X.

----
% java -version
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-39)
Java HotSpot(TM) Client VM (build 1.4.1_01-14, mixed mode)
----

The test code is:
---

import org.apache.commons.lang.*;

public class OSNameTest {

    static public void main(String[] arg) {
        System.out.println(System.getProperty("os.name"));
        System.out.println(SystemUtils.IS_OS_MAC_OSX);
        System.out.println(SystemUtils.IS_OS_WINDOWS);
        System.out.println(SystemUtils.IS_JAVA_1_4);
    }
}

--
The result is:
---
Mac OS X
false
false
false
---

It should be:
--
Mac OS X
true
false
true
--

The cause:  IS_JAVA_*, IS_OS_* values are based on
JAVA_VERSOIN, OS_NAME, OS_VERSION. But JAVA_VERSION, OS_NAME,
OS_VERSION are initialized after IS_JAVA_*, IS_OS_* values.
When IS_OS_* are initialized, OS_NAME == null.

They should be declared considering the initialization order.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to