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

Mark Proctor (JIRA) jira-events at lists.jboss.org
Wed May 13 15:38:47 EDT 2009


     [ https://jira.jboss.org/jira/browse/JBRULES-1931?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Proctor closed JBRULES-1931.
---------------------------------

    Resolution: Won't Fix


> 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