[rules-users] Strange rule compilation issue.

Brice Figureau brice+drools at daysofwonder.com
Fri Feb 5 03:26:23 EST 2010


Hi,

On Thu, 2010-02-04 at 16:04 -0500, Edson Tirelli wrote:
> 
>    Ok, this one was hidden for a long time. Interesting no one
> stumbled on it before you. 
> 
> https://jira.jboss.org/jira/browse/JBRULES-2424
> 
>    The problem is triggered in case your fact class/interface has a
> method that matches the following 3 conditions:
> 
> * it is public
> * its name starts with "set"
> * it has no parameters
> 
>     Your fact interface had a method:
> 
> public XXX setup();
> 
>     That would make the ClassFieldInspector class to raise an
> exception, making it impossible to create any field accessors for it.

I can understand why.

>     Anyway, it is fixed now on trunk (to be released in M2) and branch
> 5.0.x. Meanwhile, the possible workaround is to break one of the three
> conditions above: either make the method non-public, or rename it to
> not start with "set" or add at least one (dummy) parameter to it.
> 
>     Thanks for reporting.

Thank you for fixing it!
I renamed the method and it is now working!
-- 
Brice Figureau
My Blog: http://www.masterzen.fr/




More information about the rules-users mailing list