Hi,<div><br></div><div>I&#39;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 &#39;New Drools Project&#39; 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() { // &lt;----- 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 &quot;setup&quot;</div><div>dialect &quot;mvel&quot;   // &lt;----- 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( &quot;setup inserted:&quot; + someBean);</div>
<div>end</div><div><br></div><div>rule &quot;should never fire&quot;</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( &quot;rule that should never fire fired !!!&quot; );</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 &#39;aaa&#39; function or change the dialect to &#39;java&#39; 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>