This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | NBBundle.getMessage(...) throws NPE rather than MRE | ||
---|---|---|---|
Product: | platform | Reporter: | santhosh <santhosh> |
Component: | -- Other -- | Assignee: | Jesse Glick <jglick> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | jchalupa |
Priority: | P4 | ||
Version: | 4.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
santhosh
2005-04-13 08:51:49 UTC
i am using netbeans 4.1 beta with j2sdk 1.4.0_02 on windows 2000 Jesse, any comments? True. Not clear why you would be doing that to begin with, though. NbBundle is intended for usage with module classes, which always have a class loader. BTW: ClassLoader.getSystemClassLoader if non-null is different from the null primordial loader, or may itself be null, so the suggested patch is not quite correct, though it may have the intended effect in common cases. Better would be to use CL.getSystemResource if loader == null; CL.getBootstrapResource would be perfect but it is private. I am using netbeans way of internationationalizing in non-netbeans libraries I have created a class I18N.java which is same as NBBundle.jar. say xyz.jar one such jar; i have added xyz to netbeans using -classpath:a now from netbeans module, if i do: NBBundle(<someclassinxyz.jar>, "key") , it throws NPE as xyz.jar is not loaded by netbeans classloader. here xyz.jar is loaded by java system/bootstrap classloader. this is the sideeffect of following netbeans i18n conventions in non-netbeans modules which were loaded by systemclassloader when used in netbeans. Odd; ClassLoader for a JAR added via -classpath:a should not be null, at least not in the Sun JRE: null means the bootstrap class loader, i.e. rt.jar and its associates only. Only reproducible for JRE classes, not for -classpath classes. Anyway, fixed. Checking in src/org/openide/util/NbBundle.java; /shared/data/ccvs/repository/openide/util/src/org/openide/util/NbBundle.java,v <-- NbBundle.java new revision: 1.15; previous revision: 1.14 done Checking in test/unit/src/org/openide/util/NbBundleTest.java; /shared/data/ccvs/repository/openide/util/test/unit/src/org/openide/util/NbBundleTest.java,v <-- NbBundleTest.java new revision: 1.4; previous revision: 1.3 done |