Hi,<div><br></div><div>I've encountered a bizarre bug when a function is used together with a declared type and a rule with mvel dialect.</div><div><br></div><div>To reproduce create a default 'New Drools Project' in Eclipse and replace Sample.drl with the following:</div>
<div><div>--------------------------------------------------------------------------</div>
<div><div>package com.sample</div><div> </div><div>function void aaa() { // <----- comment this and it will work</div><div>}</div><div><br></div><div>declare SomeBean<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>prop : int</div><div>end</div><div> </div><div>rule "setup"</div><div>dialect "mvel" // <----- comment this and it will work</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>when</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>eval(true)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>then</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>SomeBean someBean = new SomeBean();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>insert(someBean);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>System.out.println( "setup inserted:" + someBean);</div>
<div>end</div><div><br></div><div>rule "should never fire"</div><div>salience -20</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>when</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>not SomeBean()</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>then</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>System.out.println( "rule that should never fire fired !!!" );</div>
<div>end</div></div></div>
<div>------------------------------------------------------------------------</div><div><br></div><div>Run the DroolsTest.java and see that the last rule that should never fire is actually fired. If you comment out the 'aaa' function or change the dialect to 'java' all works fine.</div>
<div><br></div><div>Note that it breaks on JDK 1.5.0_12 however it works fine on JDK 1.6.0_14.</div><div>Tested on WinXP.</div><div><br></div><div>Is it just my machine or does anybody else see this issue?</div><div><br></div>
<div>Best regards,</div><div>Michal</div>