From 6ec076862ee108b941137ba142a6249510f923bf Mon Sep 17 00:00:00 2001 From: Gabriele-Cardosi Date: Tue, 5 Mar 2024 15:14:46 +0100 Subject: [PATCH] [8.40.x_incubator-kie-issues#988] Fix cherry pick --- .../generator/drlxparse/ConstraintParser.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/generator/drlxparse/ConstraintParser.java b/drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/generator/drlxparse/ConstraintParser.java index fca0894878e..1ae89fcaa97 100644 --- a/drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/generator/drlxparse/ConstraintParser.java +++ b/drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/generator/drlxparse/ConstraintParser.java @@ -48,7 +48,6 @@ import com.github.javaparser.ast.expr.UnaryExpr; import com.github.javaparser.ast.nodeTypes.NodeWithArguments; import com.github.javaparser.ast.nodeTypes.NodeWithOptionalScope; -import org.drools.util.DateUtils; import org.drools.model.Index; import org.drools.model.codegen.execmodel.PackageModel; import org.drools.model.codegen.execmodel.errors.ParseExpressionErrorResult; @@ -73,6 +72,7 @@ import org.drools.mvel.parser.printer.PrintUtil; import org.drools.mvelcompiler.CompiledExpressionResult; import org.drools.mvelcompiler.ConstraintCompiler; +import org.drools.util.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -95,10 +95,6 @@ import static org.drools.model.codegen.execmodel.generator.ConstraintUtil.GREATER_THAN_PREFIX; import static org.drools.model.codegen.execmodel.generator.ConstraintUtil.LESS_OR_EQUAL_PREFIX; import static org.drools.model.codegen.execmodel.generator.ConstraintUtil.LESS_THAN_PREFIX; -import static org.drools.model.codegen.execmodel.generator.expressiontyper.ExpressionTyper.convertArithmeticBinaryToMethodCall; -import static org.drools.model.codegen.execmodel.generator.expressiontyper.ExpressionTyper.getBinaryTypeAfterConversion; -import static org.drools.model.codegen.execmodel.generator.expressiontyper.ExpressionTyper.shouldConvertArithmeticBinaryToMethodCall; -import static org.drools.util.StringUtils.lcFirstForBean; import static org.drools.model.codegen.execmodel.generator.DrlxParseUtil.THIS_PLACEHOLDER; import static org.drools.model.codegen.execmodel.generator.DrlxParseUtil.createConstraintCompiler; import static org.drools.model.codegen.execmodel.generator.DrlxParseUtil.getLiteralExpressionType; @@ -108,9 +104,13 @@ import static org.drools.model.codegen.execmodel.generator.DslMethodNames.createDslTopLevelMethod; import static org.drools.model.codegen.execmodel.generator.drlxparse.MultipleDrlxParseSuccess.createMultipleDrlxParseSuccess; import static org.drools.model.codegen.execmodel.generator.drlxparse.SpecialComparisonCase.specialComparisonFactory; +import static org.drools.model.codegen.execmodel.generator.expressiontyper.ExpressionTyper.convertArithmeticBinaryToMethodCall; +import static org.drools.model.codegen.execmodel.generator.expressiontyper.ExpressionTyper.getBinaryTypeAfterConversion; +import static org.drools.model.codegen.execmodel.generator.expressiontyper.ExpressionTyper.shouldConvertArithmeticBinaryToMethodCall; import static org.drools.model.codegen.execmodel.generator.expressiontyper.FlattenScope.transformFullyQualifiedInlineCastExpr; import static org.drools.mvel.parser.printer.PrintUtil.printNode; import static org.drools.mvel.parser.utils.AstUtils.isLogicalOperator; +import static org.drools.util.StringUtils.lcFirstForBean; /** * Parses the MVEL String Constraint and compiles it to a Java Expression @@ -512,7 +512,7 @@ private DrlxParseResult parseNameExpr(DrlNameExpr nameExpr, Class patternType } if (context.hasDeclaration( expression )) { - Optional declarationSpec = context.getTypedDeclarationById(expression); + Optional declarationSpec = context.getDeclarationById(expression); if (declarationSpec.isPresent()) { return new SingleDrlxParseSuccess(patternType, bindingId, context.getVarExpr(printNode(drlxExpr)), declarationSpec.get().getDeclarationClass() ).setIsPredicate(true); } else {