[jboss-jira] [JBoss JIRA] (JBRULES-3587) Declarations from "declare" sections don't apply to sub-classes if those live in a different package
Jörg Henne (JIRA)
jira-events at lists.jboss.org
Mon Jul 30 09:59:06 EDT 2012
Jörg Henne created JBRULES-3587:
-----------------------------------
Summary: Declarations from "declare" sections don't apply to sub-classes if those live in a different package
Key: JBRULES-3587
URL: https://issues.jboss.org/browse/JBRULES-3587
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler
Affects Versions: 5.4.0.Final
Reporter: Jörg Henne
Assignee: Mark Proctor
Declarations (like {{@role(event)}}) in a {{declare}}-Section should apply to sub-classes of the declared class, too, but don't if the sub-class resides in a different package than the base class.
Attached you'll find an example which demonstrates the issue. The class {{ButtonEvent}} derives from {{VSCPEvent}} which is declared with{{@role(event)}}. Running {{com.levigo.overlord.DroolsTest}} yields a {{java.lang.ClassCastException: org.drools.common.DefaultFactHandle}} which is caused by the ButtonEvent not being recognized as an event instead of a fact.
The Problem goes away if {{ButtonEvent}} is declared as an event (uncomment the section in {{overlord.drl}} or {{ButtonEvent}} is moved to the same package as {{VSCPEvent}}.
For more information see the referenced forum thread.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list