[rules-users] Only simple types?

Stephen Masters stephen.masters at me.com
Fri Mar 22 13:20:45 EDT 2013


Are you in control of the JAXB code generation? If so, there are a number of plugins about which enable you to control the generation of booleans.

One I found was:
https://code.google.com/p/nebulent-xjc-booleangetter/wiki/AboutThisProject
… although I haven't used it and have no idea how it compares to alternatives.

At least that way you could ensure that there is an additional getSomething() method generated.

Steve


On 22 Mar 2013, at 16:57, Wolfgang Laun <wolfgang.laun at gmail.com> wrote:

> Heck, I would have considered changing Boolean to boolean, which also
> works in 5.[45].0, but these classes are JAXB generated, and so
> there's a good reason for the capital 'B', and I'm stuck with this,
> and the is...()
> 
> And isSomething() works fine if the return type is *b*oolean.
> 
> -W
> 
> On 22/03/2013, Stephen Masters <stephen.masters at me.com> wrote:
>> Hi Wolfgang,
>> 
>> I came across this (or very similar) recently. I think the issue is the
>> bean-style naming convention. The convention is (apparently):
>> 
>> boolean => isSomething()
>> Boolean => getSomething()
>> 
>> … which means that Boolean properties are not so readable as boolean.
>> 
>> Worth giving it a quick try on one of your classes.
>> 
>> Steve
>> 
>> 
>> On 22 Mar 2013, at 16:01, Wolfgang Laun <wolfgang.laun at gmail.com> wrote:
>> 
>>> Here I have lots of classes with Boolean methods such as
>>>  Boolean isSomething()
>>> and a large number of rules where
>>>  X(... something == true,...)
>>> used to work fine not too long ago. But 5.5.0 and 5.4.0 claim that
>>> this isn't correct:
>>> Unable to Analyse Expression adult == true:
>>> [Error: unable to resolve method using strict-mode:
>>> express.Person.adult()]
>>> [Near : {... adult == true ....}]
>>> 
>>> This used to work in 5.3.0.
>>> 
>>> Trying to avoid the Boolean/bool discrepancy, I replaced true with the
>>> object:
>>>  X(... something == Boolean.TRUE,...)
>>> but being as strict as possible doesn't work, too, neither in 5.4.0nor
>>> 5.5.0.
>>> 
>>> This used to work in 5.3.0, and so did the very simple
>>>  X(... something,...)
>>> but not any more.
>>> 
>>> The fact that all of the following work in 5.5.0
>>>  X(... isSomething(),... )
>>>  X(... isSomething() == true,... )
>>>  X(... isSomething() == Boolean.TRUE,... )
>>> is certainly nice, but:
>>> 
>>> Since I'm going to have to change a ton of rules: Which of these
>>> versions should I use to have best chances for future compatibility?
>>> 
>>> Thanks
>>> -W
>>> _______________________________________________
>>> rules-users mailing list
>>> rules-users at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>> 
>> 
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>> 
> 
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130322/b2068be7/attachment-0001.html 


More information about the rules-users mailing list