{"record":{"id":"9210a4e4f6510147","repo":"quarkusio/quarkus","slug":"a-message-bundle-interface-method-must-not-use-the","errorCode":null,"errorMessage":"A message bundle interface method must not use the key 'message' which is reserved for dynamic lookup; defined for %s#%s()","messagePattern":"A message bundle interface method must not use the key 'message' which is reserved for dynamic lookup; defined for (.+?)#(.+?)\\(\\)","errorType":"exception","errorClass":"MessageBundleException","httpStatus":null,"severity":"error","filePath":"extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java","lineNumber":1065,"sourceCode":"                                method.parameterTypes().toArray(new Type[] {}));\n                        if (defaultBundleMethod == null) {\n                            throw new MessageBundleException(\n                                    String.format(\"Default bundle method not found on %s: %s\", bundleInterface, method));\n                        }\n                        messageAnnotation = defaultBundleMethod.annotation(Names.MESSAGE);\n                    } else {\n                        messageAnnotation = method.annotation(Names.MESSAGE);\n                    }\n\n                    if (messageAnnotation == null) {\n                        LOG.debugf(\"@Message not declared on %s#%s - using the default key/value\", bundleInterface, method);\n                        messageAnnotation = AnnotationInstance.builder(Names.MESSAGE).value(Message.DEFAULT_VALUE)\n                                .add(\"name\", Message.DEFAULT_NAME).build();\n                    }\n\n                    String key = getKey(method, messageAnnotation, defaultKeyValue);\n                    if (key.equals(MESSAGE)) {\n                        throw new MessageBundleException(String.format(\n                                \"A message bundle interface method must not use the key 'message' which is reserved for dynamic lookup; defined for %s#%s()\",\n                                bundleInterface, method.name()));\n                    }\n                    if (keyMap.containsKey(key)) {\n                        throw new MessageBundleException(String.format(\"Duplicate key [%s] found on %s\", key, bundleInterface));\n                    }\n                    keyMap.put(key, new SimpleMessageMethod(method));\n\n                    boolean generatedTemplate = false;\n                    String messageTemplate = messageTemplates.get(method.name());\n                    if (messageTemplate == null) {\n                        messageTemplate = getMessageAnnotationValue(messageAnnotation, true);\n                    }\n\n                    if (messageTemplate == null && defaultBundleInterface != null) {\n                        // method is annotated with @Message without value() -> fallback to default locale\n                        messageTemplate = getMessageAnnotationValue((defaultBundleInterface.method(method.name(),\n                                method.parameterTypes().toArray(new Type[] {}))).annotation(Names.MESSAGE), true);","sourceCodeStart":1047,"sourceCodeEnd":1083,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java#L1047-L1083","documentation":"The key 'message' is reserved by Qute for dynamic message lookup ({msg:message(key)}). A bundle interface method whose derived key (from method name or @Message#key) equals 'message' would collide with this reserved mechanism, so the build fails for that method.","triggerScenarios":"Declaring a bundle method named `message()` or annotating a method with `@Message(key = \"message\")`.","commonSituations":"Naming a method after a generic concept ('message', 'text'); migrating from frameworks where 'message' was a legal key; writing a catch-all lookup method intending dynamic behavior but statically defined instead.","solutions":["Rename the method (e.g. `getMessage()`) or change its @Message key to something other than 'message'.","If dynamic lookup is intended, remove the method and use `{msg:message('some.key')}` in templates instead.","Rebuild after the rename to confirm uniqueness against the reserved key."],"exampleFix":"// before\n@Message(key = \"message\")\nString message();\n\n// after\n@Message(\"Fallback message\")\nString fallbackMessage();","handlingStrategy":"validation","validationCode":"// Reject methods resolving to the reserved key 'message'\nfor (java.lang.reflect.Method m : AppMessages.class.getDeclaredMethods()) {\n    Message msg = m.getAnnotation(Message.class);\n    String key = (msg != null && !Message.DEFAULT_NAME.equals(msg.key())) ? msg.key() : m.getName();\n    if (\"message\".equals(key)) throw new IllegalStateException(\"Reserved key on: \" + m);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never name bundle methods 'message'","Use msg:message(key) in templates for dynamic lookup instead of a static method","Reserve common generic names in your i18n naming conventions"],"tags":["quarkus","qute","message-bundle","reserved-keyword"],"backgroundTag":"message-key-mismatch","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"}