Harmony
  1. Harmony
  2. HARMONY-6589

[classlib][luni] Cannot pick up proper user.language and user.country properties

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0M14
    • Fix Version/s: 6.0M3, 5.0M15
    • Component/s: Classlib
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      Test with below test case:

      public class Test {

      public static void main(String[] args)

      { String lang = System.getProperty("user.language"); String country = System.getProperty("user.country"); System.out.println("user.language=" + lang); System.out.println("user.contry=" + country); }

      }

      it always print out
      user.language=en
      user.contry=US
      even if system language and region are set to other values.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        4h 17m 1 Oliver Deakin 16/Jul/10 11:28
        Hide
        Hudson added a comment -

        Integrated in Harmony-1.5-head-linux-x86_64 #899 (See http://hudson.zones.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/899/)

        Show
        Hudson added a comment - Integrated in Harmony-1.5-head-linux-x86_64 #899 (See http://hudson.zones.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/899/ )
        Hide
        Hudson added a comment -

        Integrated in Harmony-select-1.5-head-linux-x86_64 #67 (See http://hudson.zones.apache.org/hudson/job/Harmony-select-1.5-head-linux-x86_64/67/)
        Apply patch for HARMONY-6589 ([classlib][luni] Cannot pick up proper user.language and user.country properties)

        Show
        Hudson added a comment - Integrated in Harmony-select-1.5-head-linux-x86_64 #67 (See http://hudson.zones.apache.org/hudson/job/Harmony-select-1.5-head-linux-x86_64/67/ ) Apply patch for HARMONY-6589 ( [classlib] [luni] Cannot pick up proper user.language and user.country properties)
        Oliver Deakin made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 6.0M3 [ 12315055 ]
        Fix Version/s 5.0M15 [ 12315054 ]
        Resolution Fixed [ 1 ]
        Hide
        Oliver Deakin added a comment -

        Thanks! Patch applied at repo revision r964734. Please check that it was applied as expected.

        Show
        Oliver Deakin added a comment - Thanks! Patch applied at repo revision r964734. Please check that it was applied as expected.
        Oliver Deakin made changes -
        Assignee Oliver Deakin [ odeakin ]
        Xiao Shu made changes -
        Field Original Value New Value
        Attachment Harmony-6589.diff [ 12449647 ]
        Hide
        Xiao Shu added a comment -

        Th patch contains the fix.

        In luniglob.c
        change
        propRes = (*vmInterface)->SetSystemProperty (vmInterface, "user.language", "en");
        propRes = (*vmInterface)->SetSystemProperty (vmInterface, "user.country", "US");
        to
        propRes = (*vmInterface)->SetSystemProperty (vmInterface, "user.language", (char *)hynls_get_language());
        propRes = (*vmInterface)->SetSystemProperty (vmInterface, "user.country", (char *)hynls_get_region());

        Thus user.language and user.country will pick proper value.

        Since the values of the two system properties depends on system setting, I could not add a unit tets case for it.

        Show
        Xiao Shu added a comment - Th patch contains the fix. In luniglob.c change propRes = (*vmInterface)->SetSystemProperty (vmInterface, "user.language", "en"); propRes = (*vmInterface)->SetSystemProperty (vmInterface, "user.country", "US"); to propRes = (*vmInterface)->SetSystemProperty (vmInterface, "user.language", (char *)hynls_get_language()); propRes = (*vmInterface)->SetSystemProperty (vmInterface, "user.country", (char *)hynls_get_region()); Thus user.language and user.country will pick proper value. Since the values of the two system properties depends on system setting, I could not add a unit tets case for it.
        Xiao Shu created issue -

          People

          • Assignee:
            Oliver Deakin
            Reporter:
            Xiao Shu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development