JDK-6257228 : (lc) JCK test cases for java.util.Locale fail in Mustang b32
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-04-19
  • Updated: 2017-05-16
  • Resolved: 2005-12-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 rcFixed
Related Reports
Relates :  
Relates :  
Description
The following is the output from the JCK run.

command: com.sun.jck.lib.ExecJCKTestOtherJVMCmd /java/re/j2se/6.0/promoted/ea/b32/binaries/linux-i586/bin/java -esa -verify -classpath /export/disk3/tests/jck/1.5/promoted/rc/b23/binaries/JCK-runtime-15/classes -Djava.security.policy=/export/disk3/tests/jck/1.5/promoted/rc/b23/binaries/JCK-runtime-15/lib/jck.policy javasoft.sqe.tests.api.java.util.Locale.getDisplayLanguageTests -TestCaseID ALL

Locale2031: Passed. OK
Locale2032: Passed. OK
Locale2033: Passed. OK
Locale0003: Failed. Locale.getDisplayLanguage(null) returned wrong value : en locale = en
Locale2035: Passed. OK
Locale2036: Passed. OK
STATUS:Failed.test cases: 6; passed: 5; failed: 1; first test case failure: Locale0003

command: com.sun.jck.lib.ExecJCKTestOtherJVMCmd /java/re/j2se/6.0/promoted/ea/b32/binaries/linux-i586/bin/java -esa -verify -classpath /export/disk3/tests/jck/1.5/promoted/rc/b23/binaries/JCK-runtime-15/classes -Djava.security.policy=/export/disk3/tests/jck/1.5/promoted/rc/b23/binaries/JCK-runtime-15/lib/jck.policy javasoft.sqe.tests.api.java.util.Locale.getDisplayCountryTests -TestCaseID ALL

Locale2025: Passed. OK
Locale2026: Passed. OK
Locale2027: Passed. OK
Locale0002: Failed. Locale.getDisplayCountry(null) returned wrong value : NO locale = no_NO_NY
Locale2029: Passed. OK
Locale2030: Passed. OK
STATUS:Failed.test cases: 6; passed: 5; failed: 1; first test case failure: Locale0002

All the Locale test cases passed in b31.
###@###.### 2005-04-19 08:53:15 GMT

Comments
SUGGESTED FIX It would be easy to restore the previous behavior to keep the JCK happy. However, the old behavior was clearly just an accident of the implementation, not a design, and it's unlikely that applications depend on it. A better fix would be to specify that NullPointerException is thrown if inLocale is null, independent of other factors, and add the test for inLocale == null at the beginning of the methods. This does require a CCC request. *** (#1 of 1): [ UNSAVED ] ###@###.###
27-07-2005

EVALUATION The tests require that getDisplayLanguage and getDisplayCountry throw a NullPointerException if inLocale is null, unless the language (for getDisplayLanguage) or the country (for getDisplayCountry) is empty, in which case the empty string is returned. The tests have no basis in the specification, but simply reflect the behavior of the old implementation. The new implementation that's part of the 5013088 change does not throw an exception anymore, but instead returns the language or country code if inLocale is null. The specification says nothing about the behavior when inLocale is null. ###@###.### 2005-04-19 19:39:14 GMT The problem is not observable since b38 build with the locale sensitive services SPI change (4052440). Keeping this bug open for the spec update (NullPointerException), but lowered the priority.
19-04-2005