[
https://jira.jboss.org/jira/browse/JBRULES-1931?page=com.atlassian.jira.p...
]
Mark Proctor commented on JBRULES-1931:
---------------------------------------
The interfaces are for us to define what is public and along with factories to take
control of the impl, so we can easily change it. The design was never for people to
provide their own implementations, we rely far too much on "internal" methods.
Over time we might standardise an "internal" interface for stuff, so that you
can do that, but it will take a while as it's low priority.
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