From ec4e9572ce4545e3cf0720e8302f03ee45f85ae3 Mon Sep 17 00:00:00 2001 From: Octavian Patrascoiu Date: Fri, 17 May 2024 14:21:42 +0100 Subject: [PATCH] Simplify logic when converting unary tests --- .../gs/dmn/feel/analysis/syntax/ast/ASTFactory.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/dmn-core/src/main/java/com/gs/dmn/feel/analysis/syntax/ast/ASTFactory.java b/dmn-core/src/main/java/com/gs/dmn/feel/analysis/syntax/ast/ASTFactory.java index e38dbf4a7..adb1a1b77 100644 --- a/dmn-core/src/main/java/com/gs/dmn/feel/analysis/syntax/ast/ASTFactory.java +++ b/dmn-core/src/main/java/com/gs/dmn/feel/analysis/syntax/ast/ASTFactory.java @@ -191,18 +191,12 @@ public UnaryTests toAny() { } public PositiveUnaryTest toPositiveUnaryTest(Expression expression) { - if (expression instanceof SimplePositiveUnaryTest) { - // since DMN 1.1 - return (PositiveUnaryTest) expression; - } else if (expression instanceof NullTest) { + if (expression instanceof PositiveUnaryTest) { // since DMN 1.1 return (PositiveUnaryTest) expression; } else if (expression instanceof NullLiteral) { // since DMN 1.1 return toNullPositiveUnaryTest(); - } else if (expression instanceof NamedExpression || expression instanceof PathExpression) { - // since DMN 1.1 - return toOperatorRange(null, expression); } else if (expression instanceof SimpleLiteral) { // since DMN 1.1 return toOperatorRange(null, expression); @@ -219,9 +213,6 @@ public PositiveUnaryTest toPositiveUnaryTest(Expression expression) { } } return toListTest((ListLiteral) toListLiteral(puts)); - } else if (expression instanceof ExpressionTest) { - // since DMN 1.2 - return (PositiveUnaryTest) expression; } else { // Since DMN 1.2 if (containsQuestionMark(expression)) {