[rules-dev] possible bug, NPE in PackageBuilder.java

Zoltan Farkas zoly at daxtechnologies.com
Thu Dec 18 17:16:56 EST 2008


PackageBuilder.java at line 688:
 
    public synchronized void addPackage(final Package newPkg) {
            Package pkg = this.pkgRegistryMap.get( newPkg.getName()
).getPackage();

 
if pkgRegistryMap is empty as it should probably be initially adding a
new package will cause a NPE.
This fuction assumes that there is always a package in the
packageRegistryMap.
 
I am getting a NPE when I am trying something like:
 
                KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
                kbuilder.add(ResourceFactory.newUrlResource("a valid
url"),
                        ResourceType.PKG);
 
thanks for any help
 
--zoly
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20081218/dbe9e5bb/attachment.html 


More information about the rules-dev mailing list