Bug 724400 (BRMS-346)

Summary: "<=" and ">=" operators in a rule pattern cause test scenarios to fail on facts of type BigInteger
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Tihomir Surdilovic <tsurdilo>
Component: unspecifiedAssignee: Tihomir Surdilovic <tsurdilo>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: high    
Version: 5.0.1CC: maarten.daalder
Target Milestone: ---   
Target Release: 5.1.0 GA   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/BRMS-346
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-15 17:36:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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.