[jboss-jira] [JBoss JIRA] Reopened: (JBRULES-1284) ClassCastException when using "<" constraint on field of type java.lang.Object containing data of type java.lang.Integer

Edson Tirelli (JIRA) jira-events at lists.jboss.org
Thu Nov 8 18:09:44 EST 2007


     [ http://jira.jboss.com/jira/browse/JBRULES-1284?page=all ]

Edson Tirelli reopened JBRULES-1284:
------------------------------------

             
There are still problems with alpha-hashing.

Pretend you have 3 rules:

rule "r1"
when
    MyFact( object == "true" )
then
end

rule "r2"
when
    MyFact( object == "Bob" )
then
end

rule "r2"
when
    MyFact( object == 15 )
then
end

The above 3 rules will cause the engine to hash the values "true" and "Bob" as strings and 15 as an Integer. Although, if the object attribute is set to something like a Boolean object, the hashcode will never match with the String "true" hashcode and as so will never propagate. Not sure yet how to fix that...



> ClassCastException when using "<" constraint on field of type java.lang.Object containing data of type java.lang.Integer
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBRULES-1284
>                 URL: http://jira.jboss.com/jira/browse/JBRULES-1284
>             Project: JBoss Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 4.0.2
>         Environment: Windows XP, Eclipse 3.2
>            Reporter: Justin Wick
>         Assigned To: Edson Tirelli
>             Fix For: 4.1.0, 4.0.4
>
>         Attachments: DroolsTest.zip
>
>
> If I'm doing a pattern constraint, say "< 50" on a field, and that field is type java.lang.Object, with a value of type java.lang.Integer, a ClassCastException is generated at run time, although there is no compile-time error saying that this is an illegal constraint.
> See attached files for an example

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

        



More information about the jboss-jira mailing list