Ticket #6514 (new defect)

Bug contains 1 commit(s) | SVN Diffs for #6514

 

Opened 3 months ago

Last modified 2 months ago

ICUResourceBundle.getKeys() throws NullPointerException with alias and no fall back

Reported by: bdrower Assigned to: yoshito
Priority: major Milestone: 4.1.2
Component: unknown Version: Current
Keywords: Cc:
Load: ibm:100 Xref:
Java Version: Operating System:
Project (C/J): ICU4J Weeks: .1
Review:

Description

in: private ICUResourceBundle findResource(String, long, HashMap, UResourceBundle ):

if(bundleName.equals(LOCALE))
{
            bundleName = baseName;
            bundle = (ICUResourceBundle)requested;
            keyPath = rpath.substring(LOCALE.length() + 2/* prepending and appending / */, rpath.length());
            locale = ((ICUResourceBundle)requested).getLocaleID();
            sub = ICUResourceBundle.findResourceWithFallback(keyPath, requested, null);
            sub.resPath = "/" + sub.getLocaleID() + "/" + keyPath;
        

findResourceWithFallback returns null because it's parent field is not set. See inside of findResourceWithFallback...line 685 calls getParent() which returns null.

Alias should be seem-less, should parent be set here? why isn't it? Because no-fallback is on?

Attachments

Change History

08/28/08 10:35:31 changed by bdrower

  • priority changed from assess to medium.
  • status changed from new to assigned.

09/17/08 11:38:39 changed by bdrower

  • owner changed from bdrower to yoshito.
  • status changed from assigned to new.

Created a workaround: "getKeysSafe()" which allows to get an enumeration of the keys in the table without calling "get" on an alias resource (which is what causes the Null pointer exception.

This is not a resolution to the problem simply a work around. When a true solution to this problem is created, the ICU2LDMLWriter should be looked at. It calls getKeysSafe() MANY times.

09/23/08 10:47:13 changed by hchapman

  • priority changed from medium to major.

09/24/08 15:38:44 changed by yoshito

  • milestone changed from 4.1.1 to 4.1.2.

A design question came up while working on this the issue. We need to figure out the correct behavior when fallback and alias is involved. Move to 4.1.2.


Add/Change #6514 (ICUResourceBundle.getKeys() throws NullPointerException with alias and no fall back)




Anti spam check: