diff --git a/dmn-core/src/main/java/com/gs/dmn/feel/synthesis/FEELToTripleNativeVisitor.java b/dmn-core/src/main/java/com/gs/dmn/feel/synthesis/FEELToTripleNativeVisitor.java index 2c3e57b13..5f8fd9c02 100644 --- a/dmn-core/src/main/java/com/gs/dmn/feel/synthesis/FEELToTripleNativeVisitor.java +++ b/dmn-core/src/main/java/com/gs/dmn/feel/synthesis/FEELToTripleNativeVisitor.java @@ -791,7 +791,7 @@ protected Triple makeCondition(String feelOperator, Expression leftOperand protected Triple makeCondition(String feelOperator, Triple leftOpd, Triple rightOpd, NativeOperator javaOperator) { if (javaOperator == null) { - handleError(String.format("Operator '%s' cannot be applied to '%s' and '%s'", feelOperator, leftOpd, rightOpd)); + handleError(makeOperatorErrorMessage(feelOperator, leftOpd, rightOpd)); return null; } else { if (javaOperator.getCardinality() == 2) { @@ -809,7 +809,7 @@ protected Triple makeCondition(String feelOperator, Triple leftOpd, Triple right } } } else { - handleError(String.format("Operator '%s' cannot be applied to '%s' and '%s'", feelOperator, leftOpd, rightOpd)); + handleError(makeOperatorErrorMessage(feelOperator, leftOpd, rightOpd)); return null; } } @@ -820,7 +820,7 @@ protected String rangeOperator(String feelOperatorName, Expression leftOpe if (javaOperator != null) { return javaOperator.getName(); } else { - handleError(String.format("Operator '%s' cannot be applied to '%s' and '%s'", feelOperatorName, leftOperand, rightOperand)); + handleError(makeOperatorErrorMessage(feelOperatorName, leftOperand, rightOperand)); return null; } } @@ -851,4 +851,8 @@ private Triple nameToTriple(String name, String javaName) { return this.triples.name(javaName); } } + + private static String makeOperatorErrorMessage(String feelOperator, Object leftOpd, Object rightOpd) { + return String.format("Operator '%s' cannot be applied to '%s' and '%s'", feelOperator, leftOpd, rightOpd); + } } \ No newline at end of file