{"record":{"id":"d4230eb637ed8a16","repo":"quarkusio/quarkus","slug":"message-bundle-method-key-not-found-on-bundl","errorCode":null,"errorMessage":"Message bundle method {key}() not found on: {bundleInterface}\n\t- file: {localizedFile}\n\t- line {index}","messagePattern":"Message bundle method (.+?)\\(\\) not found on: (.+?)\n\t- file: (.+?)\n\t- line (.+?)","errorType":"exception","errorClass":"MessageBundleException","httpStatus":null,"severity":"error","filePath":"extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java","lineNumber":897,"sourceCode":"                    continue;\n                }\n                line = line.strip();\n                if (line.startsWith(\"#\")) {\n                    // Comments are skipped\n                    continue;\n                }\n                int eqIdx = line.indexOf('=');\n                if (eqIdx == -1) {\n                    throw new MessageBundleException(\n                            \"Missing key/value separator\\n\\t- file: \" + localizedFile + \"\\n\\t- line \" + it.previousIndex());\n                }\n                String key = line.substring(0, eqIdx).strip();\n                if (keyToTemplate.containsKey(key)) {\n                    // Message template with higher priority takes precedence\n                    continue;\n                }\n                if (!hasMessageBundleMethod(bundleInterface, key) && !isEnumConstantMessageKey(key, index, bundleInterface)) {\n                    throw new MessageBundleException(\n                            \"Message bundle method \" + key + \"() not found on: \" + bundleInterface + \"\\n\\t- file: \"\n                                    + localizedFile + \"\\n\\t- line \" + it.previousIndex());\n                }\n                String value = adaptLine(line.substring(eqIdx + 1, line.length()));\n                if (value.endsWith(\"\\\\\")) {\n                    // The logical line is spread out across several normal lines\n                    StringBuilder builder = new StringBuilder(value.substring(0, value.length() - 1));\n                    constructLine(builder, it);\n                    keyToTemplate.put(key, builder.toString());\n                } else {\n                    keyToTemplate.put(key, value);\n                }\n            }\n        }\n        return keyToTemplate;\n    }\n\n    /**","sourceCodeStart":879,"sourceCodeEnd":915,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java#L879-L915","documentation":"Every key in a localized bundle .properties file must correspond to a method on the message bundle interface (or be an enum-constant message key for enums in the bundle). When a key has no matching bundle method, the build fails, listing the key, the bundle interface, the file, and the line.","triggerScenarios":"A .properties file contains `goodbye=...` but the bundle interface AppMessages has no `goodbye()` method; key renamed in the interface but the properties file not updated (or vice versa); typo in the key.","commonSituations":"Adding translations by hand before/after changing the interface; merging locale files from another project with different keys; deleting a bundle method but leaving stale entries in de/fr/es properties files.","solutions":["Add the missing method to the bundle interface (with @Message/template) so the key has a source method.","Or remove/rename the offending line in the properties file to match an existing method key.","Diff all localized files against the default bundle's keys to catch every stale key at once."],"exampleFix":"// before (messages_de.properties)\ngoodbye=Auf Wiedersehen\n// interface has only hello()\n\n// after\n// interface:\nString goodbye(String name);\n// properties:\ngoodbye=Auf Wiedersehen {name}","handlingStrategy":"validation","validationCode":"// Ensure every properties key has a matching bundle method\njava.util.Set<String> methods = java.util.Set.of(\"hello\", \"goodbye\");\njava.nio.file.Files.lines(Path.of(\"messages_de.properties\"))\n    .filter(l -> l.contains(\"=\"))\n    .map(l -> l.substring(0, l.indexOf('=')).strip())\n    .filter(k -> !methods.contains(k))\n    .forEach(k -> { throw new IllegalStateException(\"No bundle method for key: \" + k); });","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Update all locale files whenever bundle methods change","Add a CI check diffing keys across locales","Avoid hand-merging translations from other projects"],"tags":["quarkus","qute","properties-file","localization"],"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-14T00:17:10.932Z"}