{"id":"1b90f3e909eecc28","repo":"junit-team/junit5","slug":"duplicate-key-s-for-values-s-and-s","errorCode":null,"errorMessage":"Duplicate key '%s' for values '%s' and '%s'.","messagePattern":"Duplicate key '(.+?)' for values '(.+?)' and '(.+?)'\\.","errorType":"exception","errorClass":"CommandLine.ParameterException","httpStatus":null,"severity":"error","filePath":"junit-platform-console/src/main/java/org/junit/platform/console/options/TestDiscoveryOptionsMixin.java","lineNumber":242,"sourceCode":"\t\t * on the command line.\n\t\t *\n\t\t * @param map the key-value pairs to add\n\t\t * @throws CommandLine.ParameterException if the map already contains this key\n\t\t * @see <a href=\"https://github.com/junit-team/junit-framework/issues/1308\">#1308</a>\n\t\t */\n\t\t@Option(names = \"--config\", paramLabel = \"KEY=VALUE\", arity = \"1\", description = \"Set a configuration parameter for test discovery and execution. This option can be repeated.\")\n\t\tpublic void setConfigurationParameters(Map<String, String> map) {\n\t\t\tfor (String key : map.keySet()) {\n\t\t\t\tString newValue = map.get(key);\n\t\t\t\tvalidateUnique(key, newValue);\n\t\t\t\tconfigurationParameters.put(key, newValue);\n\t\t\t}\n\t\t}\n\n\t\tprivate void validateUnique(String key, String newValue) {\n\t\t\tString existing = configurationParameters.get(key);\n\t\t\tif (existing != null && !existing.equals(newValue)) {\n\t\t\t\tthrow new CommandLine.ParameterException(spec.commandLine(),\n\t\t\t\t\t\"Duplicate key '%s' for values '%s' and '%s'.\".formatted(key, existing, newValue));\n\t\t\t}\n\t\t}\n\n\t\tprivate void applyTo(TestDiscoveryOptions result) {\n\t\t\tresult.setAdditionalClasspathEntries(additionalClasspathEntries);\n\t\t\tresult.setConfigurationParametersResources(configurationParametersResources);\n\t\t\tresult.setConfigurationParameters(configurationParameters);\n\t\t}\n\t}\n\n\tpublic TestDiscoveryOptions toTestDiscoveryOptions() {\n\t\tTestDiscoveryOptions result = new TestDiscoveryOptions();\n\t\tif (this.selectorOptions != null) {\n\t\t\tthis.selectorOptions.applyTo(result);\n\t\t}\n\t\tif (this.filterOptions != null) {\n\t\t\tthis.filterOptions.applyTo(result);","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/junit-team/junit5/blob/956246301e03d757539f7b76dd5a91f298637563/junit-platform-console/src/main/java/org/junit/platform/console/options/TestDiscoveryOptionsMixin.java#L224-L260","documentation":"Error \"Duplicate key '%s' for values '%s' and '%s'.\" thrown in junit-team/junit5.","triggerScenarios":"Thrown at junit-platform-console/src/main/java/org/junit/platform/console/options/TestDiscoveryOptionsMixin.java:242 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"956246301e03d757539f7b76dd5a91f298637563","analyzedAt":"2026-08-04T19:25:17.049Z","schemaVersion":2}