[jboss-jira] [JBoss JIRA] Created: (JBRULES-1931) KnowledgeBaseImpl.addKnowledgePackage requires the KP to be a KPImpl

peter royal (JIRA) jira-events at lists.jboss.org
Thu Jan 22 17:45:44 EST 2009


KnowledgeBaseImpl.addKnowledgePackage requires the KP to be a KPImpl
--------------------------------------------------------------------

                 Key: JBRULES-1931
                 URL: https://jira.jboss.org/jira/browse/JBRULES-1931
             Project: JBoss Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-core
    Affects Versions: 5.0.0.M5
            Reporter: peter royal
            Assignee: Mark Proctor
            Priority: Minor


Wanting to hand-roll my own rules, I started out by instantiating a KnowledgeBase and went to add a KnowledgePackage. 

I was then confronted with:

{noformat}
java.lang.ClassCastException: com.example.MyKP cannot be cast to org.drools.definitions.impl.KnowledgePackageImp
	at org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:115)
{noformat}

.. while API wrappers are appreciated, if one can't pass in alternate implementations of interfaces, the dependency should be on the required type, rather than allowing a ClassCastException to occur at runtime

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list