Bug 724400 (BRMS-346) - "<=" and ">=" operators in a rule pattern cause test scenarios to fail on facts of type BigInteger
Summary: "<=" and ">=" operators in a rule pattern cause test scenarios to fail on fac...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: BRMS-346
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: unspecified
Version: 5.0.1
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: ---
: 5.1.0 GA
Assignee: Tihomir Surdilovic
QA Contact:
URL: http://jira.jboss.org/jira/browse/BRM...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-14 16:45 UTC by Tihomir Surdilovic
Modified: 2010-12-08 04:23 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-07-15 17:36:06 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker BRMS-346 0 None Closed "<=" and ">=" operators in a rule pattern cause test scenarios to fail on facts of type BigInteger 2011-08-09 02:20:18 UTC

Description Tihomir Surdilovic 2010-07-14 16:45:35 UTC
Help Desk Ticket Reference: https://access.redhat.com/issue-tracker/?module=issues&action=view&tid=1128553&gid=1354
Workaround Description: Do not use "<=" and ">=" operators in your rule patterns, but use "<" and ">" 
securitylevel_name: Public

When you have a rule pattern like for example:

$container : Container( bigIntegerValue >= "5", bigIntegerValue <= "21")

Where Container fact has a field called bigIntegerValue of type BigInteger
test scenarios fail with:

ServiceImplementation.java:loadRuleBase:1885) java.io.InvalidClassException: org.drools.base.evaluators.ComparableEvaluatorsDefinition$BigIntegerLessOrEqualEvaluator; org.drools.base.evaluators.ComparableEvaluatorsDefinition$BigIntegerLessOrEqualEvaluator; no valid constructor

I assume this would happen for all fact types that have no default constructor. The "<" and ">" operators work fine for some reason.

Comment 1 Tihomir Surdilovic 2010-07-14 16:45:52 UTC
Link: Added: This issue depends GUVNOR-569


Comment 2 Maarten Daalder 2010-07-15 07:34:58 UTC
It's not the fact types that are the problem here, the problem is that org.drools.base.evaluators.ComparableEvaluatorsDefinition$BigIntegerLessOrEqualEvaluator has a private constructor. So far we've only experienced this problem with org.drools.base.evaluators.ComparableEvaluatorsDefinition$BigIntegerLessOrEqualEvaluator and not org.drools.base.evaluators.ComparableEvaluatorsDefinition$BigIntegerGreaterOrEqualEvaluator

Comment 3 Tihomir Surdilovic 2010-07-15 16:26:11 UTC
Yes, the evaluator constructors:
public BigIntegerLessEvaluator() {...}
private BigIntegerLessOrEqualEvaluator() { ... }
public BigIntegerGreaterEvaluator() {...}
public BigIntegerGreaterOrEqualEvaluator() {...}

so the quick fix would be to change the BigIntegerLessOrEqualEvaluator() to public. 

The correct fix would be to implement externalizable on the classes which deserializes the evaluators so that we can always use the same instance.
I will open a separate JIRA for that task.


Comment 4 Tihomir Surdilovic 2010-07-15 17:36:06 UTC
Changed the BigIntegerLessOrEqualEvaluator constructor to public from private. 

Comment 5 Dana Mison 2010-10-26 05:50:33 UTC
Writer: Added: Darrin


Comment 6 Dana Mison 2010-10-26 05:55:50 UTC
Release Notes Docs Status: Added: Not Yet Documented


Comment 7 Dana Mison 2010-10-27 03:05:56 UTC
Release Notes Text: Added: test


Comment 8 Dana Mison 2010-10-27 03:13:24 UTC
Release Notes Text: Removed: test 


Comment 9 David Le Sage 2010-12-08 04:23:14 UTC
Labels: Removed: rn-dmison rn-open Added: rn-dlesage rn-done-resolved


Comment 10 David Le Sage 2010-12-08 04:23:41 UTC
Release Notes Docs Status: Removed: Not Yet Documented Added: Documented as Resolved Issue
Writer: Removed: Darrin Added: dlesage
Release Notes Text: Added: https://jira.jboss.org/browse/GUVNOR-569

Users could not utilise the "&lt;=" operator in rule patterns as this would cause an exception.  This was because the BigIntegerLessOrEqualEvaluator constructor was set to private.  It has now been made public, meaning users can utilise that operator.



Note You need to log in before you can comment on or make changes to this bug.