[jboss-jira] [JBoss JIRA] (DROOLS-4381) BigDecimal and primitive comparison error in executable-model build

Daniel Rosa (Jira) issues at jboss.org
Wed Oct 9 06:00:00 EDT 2019


    [ https://issues.jboss.org/browse/DROOLS-4381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13796660#comment-13796660 ] 

Daniel Rosa commented on DROOLS-4381:
-------------------------------------

There's a misspelling on the pull request. Instead of 4381, it is written 4831 as it follows: DROOLS-4376] [DROOLS-4377] [DROOLS-4831] (#2490) 
The commit related to this issue can be found here: https://github.com/kiegroup/drools/commit/e1a2be044c64a67ffd89be7bdfd724774dda624f

> BigDecimal and primitive comparison error in executable-model build
> -------------------------------------------------------------------
>
>                 Key: DROOLS-4381
>                 URL: https://issues.jboss.org/browse/DROOLS-4381
>             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 you compare BigDecimal (but the field type is Object) with primitive int,
> {noformat}
> import org.drools.modelcompiler.domain.Result;
> rule "rule1"
> when
>     $r : Result( value <= 20 )
> then
> end
> {noformat}
> executable-model build fails.
> {noformat}
> [ERROR] Failures: 
> [ERROR]   CompilerTest.testBigDecimalIntCoercion:1901->BaseModelTest.getKieSession:99->BaseModelTest.getKieSession:103->BaseModelTest.getKieContainer:107->BaseModelTest.getKieContainer:114->BaseModelTest.createKieBuilder:125->BaseModelTest.createKieBuilder:152 [Message [id=1, level=ERROR, path=src/main/java/defaultpkg/RulesC992C95703C3473926B5B025D30097DARuleMethods0.java, line=24, column=122
>    text=no suitable method found for lessOrEqualNumbers(java.lang.Object,int)
>     method org.drools.modelcompiler.util.EvaluationUtil.lessOrEqualNumbers(java.lang.Number,java.lang.Number) is not applicable
>       (argument mismatch; java.lang.Object cannot be converted to java.lang.Number)
>     method org.drools.modelcompiler.util.EvaluationUtil.lessOrEqualNumbers(java.lang.Long,java.lang.Long) is not applicable
>       (argument mismatch; java.lang.Object cannot be converted to java.lang.Long)], Message [id=2, level=ERROR, path=src/main/java/defaultpkg/RulesC992C95703C3473926B5B025D30097DARuleMethods0.java, line=0, column=0
>    text=Java source of src/main/java/defaultpkg/RulesC992C95703C3473926B5B025D30097DARuleMethods0.java in error:
> {noformat}
> Non executable-model works with the rule.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the jboss-jira mailing list