{"record":{"id":"8b7981fb7befa5f6","repo":"quarkusio/quarkus","slug":"unknown-parameter-entry-getkey-entry-getva","errorCode":null,"errorMessage":"Unknown parameter ${entry.getKey()}: ${entry.getValue()}","messagePattern":"Unknown parameter (.+?): (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ContextConfigurator.java","lineNumber":168,"sourceCode":"\n            LocalVar params = bc.localVar(\"params\", bc.new_(HashMap.class));\n            bc.withMap(params).put(Const.of(ContextCreator.KEY_CURRENT_CONTEXT_FACTORY), cg.currentContextFactory());\n            for (Entry<String, Object> entry : this.params.entrySet()) {\n                Expr value;\n                if (entry.getValue() instanceof String s) {\n                    value = Const.of(s);\n                } else if (entry.getValue() instanceof Integer i) {\n                    value = Const.of(i);\n                } else if (entry.getValue() instanceof Long l) {\n                    value = Const.of(l);\n                } else if (entry.getValue() instanceof Double d) {\n                    value = Const.of(d);\n                } else if (entry.getValue() instanceof Class<?> c) {\n                    value = Const.of(c);\n                } else if (entry.getValue() instanceof Boolean b) {\n                    value = Const.of(b);\n                } else {\n                    throw new IllegalArgumentException(\"Unknown parameter \" + entry.getKey() + \": \" + entry.getValue());\n                }\n                bc.withMap(params).put(Const.of(entry.getKey()), value);\n            }\n            Expr creator = bc.new_(creatorClazz);\n            return bc.invokeInterface(\n                    MethodDesc.of(ContextCreator.class, \"create\", InjectableContext.class, Map.class),\n                    creator, params);\n        });\n    }\n\n    public ContextConfigurator creator(Function<CreateGeneration, Expr> creator) {\n        this.creator = creator;\n        return this;\n    }\n\n    public void done() {\n        if (consumed.compareAndSet(false, true)) {\n            Objects.requireNonNull(creator);","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ContextConfigurator.java#L150-L186","documentation":"ContextConfigurator.creator() builds a Map of parameters to pass to a ContextCreator. Only String, enum, Class, and Boolean values can be encoded as compile-time constants in generated bytecode; any other parameter type is rejected with this IllegalArgumentException at build time.","triggerScenarios":"Calling creator(clazz, Map.of(\"key\", someObject)) with a value that is not a String, Class, enum constant, or Boolean (e.g. Integer, List, custom POJO, null).","commonSituations":"Passing an Integer or int autoboxed constant; passing a config object; passing a Map.copyOf map containing mixed types like Integer values.","solutions":["Convert numeric or other primitives to String or Boolean parameters","Pass a Class or enum constant instead of an instance","Handle complex state inside the ContextCreator itself (read config statically) rather than via parameters","Check the Map contents against the supported types: String, Class, enum, Boolean"],"exampleFix":"// before\ncreator(MyCreator.class, Map.of(\"timeout\", 30))\n// after\ncreator(MyCreator.class, Map.of(\"timeout\", \"30\"))","handlingStrategy":"validation","validationCode":"static void validateCreatorParams(Map<String, Object> params) {\n  for (var e : params.entrySet()) {\n    Object v = e.getValue();\n    if (!(v instanceof String || v instanceof Class || v instanceof Boolean\n        || (v != null && v.getClass().isEnum())))\n      throw new IllegalArgumentException(\"Unsupported param \" + e.getKey() + \" of \" + v.getClass());\n  }\n}","typeGuard":"static boolean isSupportedParamValue(Object v) {\n  return v instanceof String || v instanceof Class || v instanceof Boolean\n      || (v != null && v.getClass().isEnum());\n}","tryCatchPattern":null,"preventionTips":["Restrict creator parameter maps to String/Class/Boolean/enum values","Encode numbers as strings and parse them inside the ContextCreator"],"tags":["quarkus","arc","cdi","context-creator","parameters"],"backgroundTag":"unsupported-context-creator-parameter","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"}