Commons Lang
  1. Commons Lang
  2. LANG-132

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      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.

        Activity

        Henri Yandell made changes -
        Affects Version/s Nightly Builds [ 12311718 ]
        Mark Thomas made changes -
        Workflow jira [ 12369767 ] Default workflow, editable Closed status [ 12602011 ]
        Henri Yandell made changes -
        Fix Version/s 2.0 Final [ 12311706 ]
        Henri Yandell made changes -
        Affects Version/s Nightly Builds [ 12311718 ]
        Henri Yandell made changes -
        Fix Version/s 2.0 Final [ 12311658 ]
        Key COM-711 LANG-132
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Component/s Lang [ 12311121 ]
        Affects Version/s Nightly Builds [ 12311648 ]
        Project Commons [ 12310458 ] Commons Lang [ 12310481 ]
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 21761 12340862
        KANEUCHI Tetsuya created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            KANEUCHI Tetsuya
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development