]
Mario Fusco resolved DROOLS-882.
--------------------------------
Fix Version/s: 6.3.0.CR2
Resolution: Done
Fixed in mvel with this commit
Variable on left of matches operator causes 'unable to resolve
method' error
----------------------------------------------------------------------------
Key: DROOLS-882
URL:
https://issues.jboss.org/browse/DROOLS-882
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 6.2.0.Final
Reporter: Andrew Bickerton
Assignee: Mario Fusco
Fix For: 6.3.0.CR2
Attachments: MatchesTest.java
Using a variable on the left of 'matches' fails in 6.2.0.FInal, when it worked in
6.1.0.Final. E.g.
when
Fact( $field : field )
RegEx( $field matches pattern )
results in
[Error: unable to resolve method: defaultpkg.RegEx.$field() [arglength=0]]
[Near : {... $field ~= pattern ....}]
This can be worked around for the positive case by simply moving the constraint, e.g.
when
RegEx( $pattern : pattern )
Fact( field matches $pattern )
But it makes it impossible to find facts that are not matched by any regex, e.g.
when
Fact( $field : field )
not RegEx( $field matches pattern )