{"record":{"id":"4394cedb061b8191","repo":"quarkusio/quarkus","slug":"unsupported-param-type","errorCode":null,"errorMessage":"Unsupported param type: ","messagePattern":"Unsupported param type: ","errorType":"exception","errorClass":"TemplateException","httpStatus":null,"severity":"error","filePath":"independent-projects/qute/core/src/main/java/io/quarkus/qute/IfSectionHelper.java","lineNumber":767,"sourceCode":"\n            for (Object p : params) {\n                if (p instanceof Operator) {\n                    nextOperator = (Operator) p;\n                } else {\n                    conditions.add(createCondition(p, block, nextOperator, context));\n                    nextOperator = null;\n                }\n            }\n\n            if (operator == null && conditions.size() == 1) {\n                condition = conditions.get(0);\n            } else if (conditions.size() == 2) {\n                condition = new DoubletonCondition(conditions.get(0), conditions.get(1), operator);\n            } else {\n                condition = new CompositeCondition(operator, ImmutableList.copyOf(conditions));\n            }\n        } else {\n            throw new TemplateException(\"Unsupported param type: \" + param);\n        }\n        return condition;\n    }\n\n    enum Code implements ErrorCode {\n\n        /**\n         * <code>{#if foo >}{/}</code>\n         */\n        BINARY_OPERATOR_MISSING_SECOND_OPERAND,\n\n        ;\n\n        @Override\n        public String getName() {\n            return \"IF_\" + name();\n        }\n","sourceCodeStart":749,"sourceCodeEnd":785,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/qute/core/src/main/java/io/quarkus/qute/IfSectionHelper.java#L749-L785","documentation":"While building the condition tree for an {#if} section, createCondition accepts only String params (single operands), List params (composite groups), and Booleans (literal true/false). Any other parameter type reaching this point cannot become a condition, so TemplateException is thrown. Normally unreachable from templates; it guards internal parser invariants.","triggerScenarios":"Passing an object of an unexpected type (neither String, List, nor Boolean) into the package-private createCondition method — usually from custom code composing section params or a framework bug where a parsed param kept an unhandled type.","commonSituations":"Custom Qute patches or third-party template tooling that constructs if-section parameters directly; otherwise effectively never seen by end users.","solutions":["Ensure params passed into the if-section machinery are only Strings, Lists (from composite parsing), or Booleans","If you write custom section-helper/param code, convert unsupported values to String or Boolean before calling createCondition","Check the Quarkus version for a known bug and report with a reproducer if a stock template triggers it"],"exampleFix":"// before\nObject param = someCustomParse(...); // e.g. Integer 42\ncondition = IfSectionHelper.createCondition(param, block, operator, context); // throws\n// after\ncondition = IfSectionHelper.createCondition(param instanceof Integer i ? i.toString() : param, block, operator, context);","handlingStrategy":"type-guard","validationCode":"// before building conditions, restrict param types\nif (!(param instanceof String || param instanceof List || param instanceof Boolean)) {\n    throw new IllegalArgumentException(\"Unsupported param: \" + param.getClass());\n}","typeGuard":"boolean isSupportedParam(Object p) {\n    return p instanceof String || p instanceof List || p instanceof Boolean;\n}","tryCatchPattern":"try {\n    condition = createCondition(param, block, operator, context);\n} catch (TemplateException e) {\n    if (e.getMessage().startsWith(\"Unsupported param type\")) {\n        throw new IllegalStateException(\"Bad param \" + param.getClass() + \"; expected String/List/Boolean\", e);\n    }\n    throw e;\n}","preventionTips":["Only feed String, List, or Boolean params into if-section helpers","Convert custom parsed values to String/Boolean before condition construction","Pin to released Quarkus versions"],"tags":["qute","template","if-section","internal"],"backgroundTag":"unsupported-type","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"}