{"record":{"id":"2c429404053adf61","repo":"quarkusio/quarkus","slug":"unable-to-resolve-map-parameter-types-for","errorCode":null,"errorMessage":"Unable to resolve Map parameter types for ","messagePattern":"Unable to resolve Map parameter types for ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/spring-boot-properties/deployment/src/main/java/io/quarkus/spring/boot/properties/deployment/ConfigurationPropertiesUtil.java","lineNumber":67,"sourceCode":"     * Generates code that uses Config#getValue for simple objects, or SmallRyeConfig#getValues if it is a Collection\n     * type.\n     *\n     * @param propertyName Property name that needs to be fetched\n     * @param resultType Type to which the property value needs to be converted to\n     * @param declaringClass Config class where the type was encountered\n     * @param bc Where the bytecode will be generated\n     * @param config Reference to the MP config object\n     */\n    static Expr createReadMandatoryValueAndConvertIfNeeded(\n            String propertyName,\n            Type resultType,\n            DotName declaringClass,\n            BlockCreator bc,\n            Expr config) {\n\n        if (isMap(resultType)) {\n            if (resultType.kind() != Kind.PARAMETERIZED_TYPE) {\n                throw new IllegalArgumentException(\"Unable to resolve Map parameter types for \" + propertyName);\n            }\n\n            ParameterizedType parameterizedType = resultType.asParameterizedType();\n            String keyType = parameterizedType.arguments().get(0).name().toString();\n            String valueType = parameterizedType.arguments().get(1).name().toString();\n\n            // Only support Map#value with Converter\n            // We don't have a way to validate, so it will fail at runtime (with a proper error message from SR Config)\n            return bc.invokeInterface(\n                    CONFIG_GET_VALUES_MAP,\n                    config,\n                    Const.of(propertyName),\n                    Const.of(Jandex2Gizmo.classDescOf(DotName.createSimple(keyType))),\n                    Const.of(Jandex2Gizmo.classDescOf(DotName.createSimple(valueType))));\n        } else if (isCollection(resultType)) {\n            Class<?> factoryToUse = DotNames.SET.equals(resultType.name()) ? HashSetFactory.class : ArrayListFactory.class;\n            return bc.invokeInterface(\n                    CONFIG_GET_VALUES_COLLECTION,","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-boot-properties/deployment/src/main/java/io/quarkus/spring/boot/properties/deployment/ConfigurationPropertiesUtil.java#L49-L85","documentation":"When generating code to read a mandatory config property whose declared return type is a Map, the extension requires the Map to be a parameterized type so key/value converters can be resolved. A raw Map (no generic arguments) triggers IllegalArgumentException 'Unable to resolve Map parameter types for <propertyName>'.","triggerScenarios":"A @ConfigurationProperties getter/method (mandatory-value path, createReadMandatoryValueAndConvertIfNeeded) declares a return type of raw Map or Map without type arguments (Kind != PARAMETERIZED_TYPE) for some property name.","commonSituations":"Returning raw Map for convenience; assigning a raw Map from legacy code; generic type erasure leaving the declared type unparameterized in an interface config property.","solutions":["Parameterize the Map, e.g. Map<String, String> or Map<String, MyType>, on the getter/field.","If truly untyped, use Map<String, String> and parse values yourself.","For interface-based config, declare the generic parameters on the method return type."],"exampleFix":"// before\nMap getSettings();\n\n// after\nMap<String, String> getSettings();","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"// Java: compiler enforces generics; avoid raw types so this fails at compile time\nstatic boolean isParameterizedMap(java.lang.reflect.Type t) {\n  return t instanceof java.lang.reflect.ParameterizedType pt\n      && pt.getRawType() == Map.class;\n}","tryCatchPattern":null,"preventionTips":["Enable raw-type lint warnings (-Xlint:rawtypes) in the IDE","Always declare Map<K, V> with concrete type arguments in config classes","Never return raw Map from config getters"],"tags":["quarkus","build-time","generics","map","illegal-argument"],"backgroundTag":"raw-type-missing-generics","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"}