Toshiya Kobayashi created DROOLS-5652:
-----------------------------------------
Summary: String relational comparison fails with executable-model
Key: DROOLS-5652
URL:
https://issues.redhat.com/browse/DROOLS-5652
Project: Drools
Issue Type: Bug
Components: executable model
Affects Versions: 7.43.1.Final
Reporter: Toshiya Kobayashi
Assignee: Toshiya Kobayashi
String relational comparison fails with executable-modelString relational comparison fails
with executable-model
{noformat}Person( name >= "Bob" )\{noformat}
generates Predicate like this:
{code:java}@org.drools.compiler.kie.builder.MaterializedLambda()public enum
LambdaPredicate3B9CCAE898D00108D2F033D685F4C75B implements
org.drools.model.functions.Predicate1<org.drools.modelcompiler.domain.Person> \{
... @Override() public boolean test(org.drools.modelcompiler.domain.Person _this)
throws java.lang.Exception { return
org.drools.modelcompiler.util.EvaluationUtil.greaterThanStringsAsNumbers(_this.getName(),
"Bob"); }}\{code}
then, fails with this error:
{noformat}[ERROR]
testStringComparison[PATTERN_DSL](org.drools.modelcompiler.CompilerTest) Time elapsed:
2.563 s <<< ERROR!java.lang.RuntimeException: java.lang.NumberFormatException:
Character J is neither a decimal digit number, decimal point, nor "e" notation
exponential mark. at
org.drools.modelcompiler.constraints.ConstraintEvaluator.evaluate(ConstraintEvaluator.java:95)
at
org.drools.modelcompiler.constraints.LambdaConstraint.isAllowed(LambdaConstraint.java:133)
at org.drools.core.reteoo.AlphaNode.assertObject(AlphaNode.java:136) ...Caused by:
java.lang.NumberFormatException: Character J is neither a decimal digit number, decimal
point, nor "e" notation exponential mark. at
java.base/java.math.BigDecimal.<init>(BigDecimal.java:518) at
java.base/java.math.BigDecimal.<init>(BigDecimal.java:401) at
java.base/java.math.BigDecimal.<init>(BigDecimal.java:834) at
org.drools.modelcompiler.util.EvaluationUtil.greaterThanStringsAsNumbers(EvaluationUtil.java:113)
at
defaultpkg.P3B.LambdaPredicate3B9CCAE898D00108D2F033D685F4C75B.test(LambdaPredicate3B9CCAE898D00108D2F033D685F4C75B.java:17)
at
defaultpkg.P3B.LambdaPredicate3B9CCAE898D00108D2F033D685F4C75B.test(LambdaPredicate3B9CCAE898D00108D2F033D685F4C75B.java:8)
at org.drools.model.functions.Predicate1$Impl.test(Predicate1.java:39) at
org.drools.modelcompiler.constraints.ConstraintEvaluator.evaluate(ConstraintEvaluator.java:92)
... 48 more\{noformat}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)