JDK-7077851 : (coll) NPE with org.unicode.cldr.util.SupplementalDataInfo in TreeMap
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: solaris_nevada
  • CPU: x86
  • Submitted: 2011-08-11
  • Updated: 2012-10-08
  • Resolved: 2011-09-06
Related Reports
Relates :  
Description
building the ar_AE.UTF-8 locale from CLDR with 1.7.0-b147 fails with the below error message. Some other locales build ok.

/usr/jdk/instances/jdk1.7.0/bin/java -Xmx512m -Dhttp.proxyHost=emeacache.uk.oracle.com -Dhttp.proxyPort=80 -DCLDR_DTD_CACHE=build/.dtd_cache -DCLDR_DIR=build/cldr_core -cp build/icu4j.jar:build/xalan.jar:build/xml-apis.jar:build/utilities.jar:build/cldr.jar org.unicode.cldr.posix.GeneratePOSIX  -d build/ar_AE.UTF-8 -o posix.src -c UTF-8 -m ar_AE@yesno=solaris,platform=solaris
Exception in thread "main" java.lang.IllegalArgumentException: path: //supplementalData/windowsZones/mapTimezones/mapZone[@other="AUS Central Standard Time"][@type="Australia/Darwin"],        value: 
        at org.unicode.cldr.util.SupplementalDataInfo$MyHandler.handlePathValue(SupplementalDataInfo.java:899)
        at org.unicode.cldr.util.XMLFileReader$MyContentHandler.endElement(XMLFileReader.java:139)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606)
        at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
        at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:766)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:353)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2715)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
        at org.unicode.cldr.util.XMLFileReader.read(XMLFileReader.java:97)
        at org.unicode.cldr.util.XMLFileReader.read(XMLFileReader.java:73)
        at org.unicode.cldr.util.SupplementalDataInfo.getInstance(SupplementalDataInfo.java:715)
        at org.unicode.cldr.posix.POSIXLocale.<init>(POSIXLocale.java:54)
        at org.unicode.cldr.posix.GeneratePOSIX.main(GeneratePOSIX.java:80)
Caused by: java.lang.NullPointerException
        at java.util.TreeMap.compare(TreeMap.java:1188)
        at java.util.TreeMap.put(TreeMap.java:531)
        at org.unicode.cldr.util.SupplementalDataInfo$MyHandler.handleMetazoneData(SupplementalDataInfo.java:1021)
        at org.unicode.cldr.util.SupplementalDataInfo$MyHandler.handlePathValue(SupplementalDataInfo.java:853)
        ... 18 more

Test files attached.
This is with the pkg://java-nightly/developer/java/###@###.###,5.11-0.172.0.0.0.0.0:20110809T212616Z that's supposed to go into build 172 of Solaris 11
It works with JDK 1.6.0_25-b06

Comments
SUGGESTED FIX diff -uwdr tools-orig/java/org/unicode/cldr/util/SupplementalDataInfo.java tools/java/org/unicode/cldr/util/SupplementalDataInfo.java --- tools-orig/java/org/unicode/cldr/util/SupplementalDataInfo.java 2010-11-29 13:41:10.000000000 -0800 +++ tools/java/org/unicode/cldr/util/SupplementalDataInfo.java 2011-08-12 10:56:07.000000000 -0700 @@ -1012,7 +1012,7 @@ Map<String, Map<String, String>> zoneToRegionToZone = typeToZoneToRegionToZone.get(maintype); if (zoneToRegionToZone == null) { - typeToZoneToRegionToZone.put(maintype, zoneToRegionToZone = new TreeMap<String, Map<String, String>>()); + typeToZoneToRegionToZone.put(maintype, zoneToRegionToZone = new HashMap<String, Map<String, String>>()); } Map<String, String> regionToZone = zoneToRegionToZone.get(mzone); if (regionToZone == null) {
12-08-2011

EVALUATION I don't see any i18n classes involved in from the stack dump. Transferring this CR to core/libs. I suspect the 5045147 fix is related to this behavioral change.
11-08-2011