]
Luca Molteni updated DROOLS-4377:
---------------------------------
Sprint: 2019 Week 29-31
Comparison error with primitive and Map in executable-model
-----------------------------------------------------------
Key: DROOLS-4377
URL:
https://issues.jboss.org/browse/DROOLS-4377
Project: Drools
Issue Type: Bug
Components: executable model
Affects Versions: 7.24.0.Final
Reporter: Toshiya Kobayashi
Assignee: Luca Molteni
Priority: Major
Labels: support
When comparing a primitive int with an Integer inside a Map,
{noformat}
import java.util.Map;
import org.drools.modelcompiler.domain.Person;
rule R1 when
$m : Map()
Person(age == $m['age'] )
then
end
{noformat}
executable-model build fails with "Comparison operation requires compatible types.
Found int and class java.lang.Object" even though the Map's value is Integer.
{noformat}
[ERROR] Failures:
[ERROR]
CompilerTest.testMapPrimitiveComparison:1905->BaseModelTest.getKieSession:99->BaseModelTest.getKieSession:103->BaseModelTest.getKieContainer:107->BaseModelTest.getKieContainer:114->BaseModelTest.createKieBuilder:125->BaseModelTest.createKieBuilder:152
[Message [id=1, kieBase=defaultKieBase, level=ERROR, path=r0.drl, line=-1, column=0
text=Comparison operation requires compatible types. Found int and class
java.lang.Object]]
{noformat}
Non executable-model has no issue with the rule.