{"record":{"id":"d2ecd0cdc19d8dcc","repo":"quarkusio/quarkus","slug":"not-a-short-circuiting-operator","errorCode":null,"errorMessage":"Not a short-circuiting operator: ","messagePattern":"Not a short-circuiting operator: ","errorType":"exception","errorClass":"TemplateException","httpStatus":null,"severity":"error","filePath":"independent-projects/qute/core/src/main/java/io/quarkus/qute/IfSectionHelper.java","lineNumber":543,"sourceCode":"                case GT:\n                    return result > 0;\n                case LE:\n                    return result <= 0;\n                case LT:\n                    return result < 0;\n                default:\n                    return false;\n            }\n        }\n\n        Boolean evaluate(Object op1) {\n            switch (this) {\n                case AND:\n                    return isFalsy(op1) ? Boolean.FALSE : null;\n                case OR:\n                    return isFalsy(op1) ? null : Boolean.TRUE;\n                default:\n                    throw new TemplateException(\"Not a short-circuiting operator: \" + this);\n            }\n        }\n\n        boolean isShortCircuiting() {\n            return AND.equals(this) || OR.equals(this);\n        }\n\n        boolean isBinary() {\n            return !NOT.equals(this);\n        }\n\n        static Operator from(String value) {\n            if (value == null || value.isEmpty()) {\n                return null;\n            }\n            for (Operator operator : values()) {\n                if (operator.aliases.contains(value)) {\n                    return operator;","sourceCodeStart":525,"sourceCodeEnd":561,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/qute/core/src/main/java/io/quarkus/qute/IfSectionHelper.java#L525-L561","documentation":"Qute's {if} section supports only the short-circuiting operators && (and) and || (or). The Operator enum's eval() method is only valid for those; any other operator reaching this default branch is a parser/internal logic bug because non-short-circuiting operators are evaluated elsewhere via evalNeitherIsShortCircuiting(). The library throws TemplateException to signal an unexpected operator state rather than silently returning a wrong boolean.","triggerScenarios":"Calling the package-private Operator.eval(operands) method on an operator other than AND or OR; in practice this only happens if a new Operator enum constant (e.g. NOT) is added but not routed through the correct evaluation path, or if reflection/internal code dispatches a non-short-circuiting operator to this switch.","commonSituations":"Developers extending Qute's if-section operator set (custom patches to IfSectionHelper) or contributing new operators to the Qute parser; end users should essentially never see this from a template unless they hit a framework bug.","solutions":["Check which operator is being evaluated; ensure && and || are written as 'and'/'&&' and 'or'/'||' in the template, not a custom/typo operator like '&' alone","If you patched Qute to add an operator, update the switch in Operator.eval() (or route the operator to isShortCircuiting()==false handling) so the default branch is unreachable","Verify your Qute version matches a released one; report the template/params upstream if a stock template triggers it"],"exampleFix":"// before (custom NOT added to enum, falls into default)\ncase NOT: return isFalsy(op1) ? Boolean.TRUE : Boolean.FALSE; // missing -> default throws\n// after\nboolean isShortCircuiting() {\n    return AND.equals(this) || OR.equals(this);\n}\n// route non-short-circuiting operators through the non-short-circuit eval path instead of Operator.eval()","handlingStrategy":"try-catch","validationCode":"// only operators && and || are short-circuiting\nif (!op.equals(\"&&\") && !op.equals(\"||\") && !op.equals(\"and\") && !op.equals(\"or\")) {\n    throw new IllegalArgumentException(\"Unsupported if-operator: \" + op);\n}","typeGuard":"boolean isShortCircuiting(String op) {\n    return \"&&\".equals(op) || \"||\".equals(op) || \"and\".equals(op) || \"or\".equals(op);\n}","tryCatchPattern":"try {\n    engine.parse(templateContent);\n} catch (TemplateException e) {\n    if (e.getMessage().startsWith(\"Not a short-circuiting operator\")) {\n        log.error(\"Template uses an unsupported if-operator; check Qute version/custom patches\", e);\n    }\n    throw e;\n}","preventionTips":["Only use and/&&/or/|| operators in {#if} conditions","Avoid patched or unreleased Qute versions in production","Parse templates eagerly at startup to fail fast"],"tags":["qute","template","if-section","operator"],"backgroundTag":"unsupported-operator","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}