Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4638720

REGRESSION: System property 'user.region' is null in 1.4.0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.0
    • core-libs
    • x86
    • windows_2000



      Name: gm110360 Date: 02/15/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

      FULL OPERATING SYSTEM VERSION :
      Microsoft Windows 2000 [Version 5.00.2195]
      service pack 2.

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Internet explorer version 5.00.3315.1000 service pack 2.


      A DESCRIPTION OF THE PROBLEM :
      Trying to get the value of user.region in 1.4.0 results in null
      while the same works in 1.3.1_02.

      Similarly, for the JRE
        From a java script a method in an applet is called to
      get the system property 'user.region'.
      In the 1.4.0 java plugin null is returned, but in the
      1.3.1 java plugin the correct user.region is returned.
      In my case 'SE'.
      The property 'user.language' works OK in both 1.3.1 and
      1.4.0.



      REGRESSION. Last worked in version 1.3

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.Create an applet with a method that returns the named
      system property.
      2.From a html page with the created applet, call the method
      to get the 'user.region. system property.
      3.In java 1.3.1 it works, but in java 1.4.0 it returns null.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Excpected result was the country code "SE", but the actual
      result was null.


      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Simple Application:

      public class Test
      {
          public static void main(String[] args)
          {
           /**
           * Get the named property from System object.
           * @param propertyName the name of the property to get.
           * @return the named property, null if not found
           */
              System.out.println(System.getProperty("user.region"));
          }
      }

      Applet:
      public class JavaScriptHelper extends java.applet.Applet
      {
          public void init()
          {
          }
        
          /**
           * Get the named property from System object.
           * @param propertyName the name of the property to get.
           * @return the named property, null if not found
           */
          public String getSystemProperty(String propertyName)
          {
              return System.getProperty(propertyName);
          }
      }

      Html (partly):

      <OBJECT
        classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
        WIDTH="0" HEIGHT="0" VSPACE="0" HSPACE="0"
        NAME="javaScriptHelper"
        codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_0-
      win.cab#Version=1,4,0,0"
      >
        <PARAM NAME="code"
      VALUE="org.stina.framework.support.util.TiJavaScriptHelper.class" />
        <PARAM NAME="codebase" VALUE="applets" />
        <PARAM NAME="archive" VALUE="ibwaa.jar" />
        <PARAM NAME="name" VALUE="javaScriptHelper" />
        <PARAM NAME="mayscript" VALUE="true" />
        <PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.4.0" />
        <PARAM NAME="scriptable" VALUE="true" />
        <PARAM NAME="scriptName" VALUE="acpselect" />
        <COMMENT>
          <EMBED
            CODE="org.stina.framework.support.util.TiJavaScriptHelper.class"
            CODEBASE="applets"
            ARCHIVE="ibwaa.jar"
            NAME="javaScriptHelper"
            MAYSCRIPT="true"
            type="application/x-java-applet;jpi-version=1.4.0"
            WIDTH="0" HEIGHT="0" VSPACE="0" HSPACE="0"
            scriptName="acpselect"
            scriptable="true"
            pluginspage="http://java.sun.com/products/plugin/autodl/jinstall-1_4_0-
      win.cab#Version=1,4,0,0"
          >
            <NOEMBED>
            </NOEMBED>
          </EMBED>
        </COMMENT>
      </OBJECT>

      java script:
      <script type="text/javascript">
      <!--
      // this returns null in 1.4.0 but correct in 1.3.1
          javaScriptHelper.getSystemProperty('user.region');
      // this return correct result both in 1.3.1 and 1.4.0
          javaScriptHelper.getSystemProperty('user.language');
      //-->
      </script>



      ---------- END SOURCE ----------

      CUSTOMER WORKAROUND :
      I havn't found one.

      Release Regression From : 1.4
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      (Review ID: 139742)
      ======================================================================

            Unassigned Unassigned
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: