bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/60259] New: getDateInstance() and getDateTimeInstance() h


From: timo.teras at iki dot fi
Subject: [Bug classpath/60259] New: getDateInstance() and getDateTimeInstance() hang locale without fallback
Date: Tue, 18 Feb 2014 08:51:02 +0000

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60259

            Bug ID: 60259
           Summary: getDateInstance() and getDateTimeInstance() hang
                    locale without fallback
           Product: classpath
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: classpath
          Assignee: unassigned at gcc dot gnu.org
          Reporter: timo.teras at iki dot fi

[Using classpath bundled with gcc 4.8.2]

If LC_MESSAGES locale is unsupported, non-existant or does not match the
expected pattern AA[_bb] where AA=language (2 bytes) and bb=region (2 bytes),
the locale handler goes to infinite loop.

Simple test case:
export LC_MESSAGES=C.UTF-8

And run:
System.out.println(java.text.DateFormat.getDateInstance());

This is two related problems:
1. The code involved is in classpath/java/text/DateFormat.java:
getDateInstance() and getDateTimeInstance(). The exception handler calls
recursively itself and causes infinite loop as the fallback locale cannot be
instantiated (for some unknown reason).

2. The code in gnu/classpath/natSystemProperties.cc interprets C.UTF-8 as
user.language='C.' and no user.region (since no underscore). This triggers the
bug if system locale is not in the expected format.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]