[rules-dev] A dotty bug
Wolfgang Laun
wolfgang.laun at gmail.com
Thu Sep 1 04:58:44 EDT 2011
Consider these six variations of a pattern constraint:
$a: Student( $someStudent.name != null )
$b: Student( $someStudent .name != null )
$c: Student( $someStudent. name != null )
$d: Student( $someStudent.getName() != null )
$e: Student( $someStudent .getName() != null )
$f: Student( $someStudent. getName() != null )
Where is the bug - surely a space next to a separator can't do any harm? But
indeed - $c is flagged with a not very helpful error message: "Unable to
build constraint as ' name' is invalid".
Now, what about $d, $e and $f? Is it also $f, b with the space after the
dot, which is flagged?
Surprise, surprise: here it is $e that's pilloried with a lot of
gobbledegook (note the invented "method" $someStudent):
Unable to Analyse Expression $someStudent .getName() != null:
[Error: unable to resolve method using strict-mode:
add2map.Student.$someStudent()]
[Near : {... $someStudent .getName() != nul ....}]
More fun of this kind is to be had from similar expressions on the RHS,
especially when dialect "mvel" is set.
Cheers
Wolfgang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20110901/1f7b2f98/attachment.html
More information about the rules-dev
mailing list