Craig Ringer
|
Posted: December 07, 2009 10:08 by Craig Ringer
|
|
... is evil. ResourceManager "helpfully" strips the class name down to just the simple, unqualified inner class name and tries to load a properties map for that. So, for MyClass$InnerClass, rather than the obvious and expected:
you must provide:
To top it off, this behavior appears to be basically undocumented. It's mentioned on the javadoc of the private method ResourceManager.classBundleBaseName(Class cls), but that won't help most users. I wasted a bit of time tracking it down as I wondered why my private inner Task subclasses weren't getting their resources properly... I've added a note to the public method ResourceManager.getResourceMap() but I still think this behaviour, documented or not, is unintuitive and painful. I'd like to look for the inner class's resource bundle by fully-qualified name first, as for any other class. If no properties file is found for the fully qualified name it should fall back on the current behaviour and check for a properties file by "simple name". Opinions? (Oh, and speaking of evil, BBCode is argh especially as implemented on Kenai.) |
Inner class ResourceMap loading by ResourceManager
Replies: 1 - Last Post: February 11, 2010 09:27
by: Anonymous User
by: Anonymous User
showing 1 - 2 of 2
Anonymous User
|
Posted: February 11, 2010 09:27 by Anonymous User
|
| I definitely agree! Thank you for ur tip! |
Replies: 1 - Last Post: February 11, 2010 09:27
by: Anonymous User
by: Anonymous User







