JDK-4277736 : VM mishandles cmd line override of Locale setting on Japanese op.sys. (Same as
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1999-10-02
  • Updated: 1999-11-12
  • Resolved: 1999-11-12
Related Reports
Relates :  
Relates :  
Description

Name: clC74495			Date: 10/02/99


4127375 reported this same bug (agains 1.2beta3), but that report has been closed, saying it would be re-assigned, and speculating, "this bug may have already been fixed."  But it still occurs in 1.3preFCS-H.
/* foo.java

1. Compile this file (foo.java)
2. Under Japanese o.s. (Win. OR Solaris) run it thus:  java -Duser.language=en -Duser.region=US foo
act: JVM can't handle cmd line override of locale setting.
---
default locale = ja_JP  <== No Good
user.language = en
user.country = null
user.region = US
---
exp: JVM should handle default locale override setting.

default locale = en_US
user.language = en
user.country = null
user.region = US
---

*/
import java.util.*;

public class foo {

  public static void main(String args[]) {
    Locale locale = Locale.getDefault();
    String language = System.getProperty("user.language");
    String country = System.getProperty("user.country");
    String region = System.getProperty("user.region");

    System.out.println("default locale = "   locale);
    System.out.println("user.language = "   language);
    System.out.println("user.country = "   country);
    System.out.println("user.region = "   region);
    System.exit(0);
  }
}
(Review ID: 96058) 
======================================================================

Comments
WORK AROUND Name: clC74495 Date: 10/02/99 none ======================================================================
11-06-2004

EVALUATION This is not a bug. The system properties are infomative. Some of them should be considered as readonly. (We probably enforce readonly properties in future release.) We will not fix this problem. In pratice, this intended feature can be achieved programmitically by using Locale.setDefault(). However there is equivalent command line option. NOTE: not everything you can control through command line options. ###@###.### 1999-11-12
12-11-1999