{"record":{"id":"7fb8a931cbab1281","repo":"projectlombok/lombok","slug":"there-is-more-than-one-parameter-definition-that-i","errorCode":null,"errorMessage":"There is more than one parameter definition that includes TOPIC: ","messagePattern":"There is more than one parameter definition that includes TOPIC: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/core/lombok/core/configuration/LogDeclaration.java","lineNumber":67,"sourceCode":"\t}\n\t\n\tpublic static LogDeclaration valueOf(String declaration) {\n\t\tif (declaration == null) return null;\n\t\t\n\t\tMatcher matcher = DECLARATION_PATTERN.matcher(declaration);\n\t\tif (!matcher.matches()) throw new IllegalArgumentException(\"The declaration must follow the pattern: [LoggerType ]LoggerFactoryType.loggerFactoryMethod(loggerFactoryMethodParams)[(loggerFactoryMethodParams)]\");\n\t\t\n\t\tTypeName loggerFactoryType = TypeName.valueOf(matcher.group(2));\n\t\tTypeName loggerType = TypeName.valueOf(matcher.group(1));\n\t\tif (loggerType == null) loggerType = loggerFactoryType;\n\t\tIdentifierName loggerFactoryMethod = IdentifierName.valueOf(matcher.group(3));\n\t\tList<List<LogFactoryParameter>> allParameters = parseParameters(matcher.group(4));\n\t\t\n\t\tList<LogFactoryParameter> parametersWithoutTopic = null;\n\t\tList<LogFactoryParameter> parametersWithTopic = null;\n\t\tfor (List<LogFactoryParameter> parameters: allParameters) {\n\t\t\tif (parameters.contains(LogFactoryParameter.TOPIC)) {\n\t\t\t\tif (parametersWithTopic != null) throw new IllegalArgumentException(\"There is more than one parameter definition that includes TOPIC: \" + parametersWithTopic + \" and \" + parameters);\n\t\t\t\tparametersWithTopic = parameters;\n\t\t\t} else {\n\t\t\t\tif (parametersWithoutTopic != null) throw new IllegalArgumentException(\"There is more than one parmaeter definition that does not include TOPIC: \" + parametersWithoutTopic + \" and \" + parameters);\n\t\t\t\tparametersWithoutTopic = parameters;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// sanity check (the pattern should disallow this situation\n\t\tif (parametersWithoutTopic == null && parametersWithTopic == null) throw new IllegalArgumentException(\"No logger factory method parameters specified.\");\n\t\t\n\t\treturn new LogDeclaration(loggerType, loggerFactoryType, loggerFactoryMethod, parametersWithoutTopic, parametersWithTopic);\n\t}\n\t\n\tprivate static List<List<LogFactoryParameter>> parseParameters(String parametersDefinitions) {\n\t\tList<List<LogFactoryParameter>> allParameters = new ArrayList<List<LogFactoryParameter>>();\n\t\tMatcher matcher = PARAMETERS_PATTERN.matcher(parametersDefinitions);\n\t\twhile (matcher.find()) {\n\t\t\tString parametersDefinition = matcher.group(1);","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/projectlombok/lombok/blob/6d6a3e9fec0a9555702561fbeb8eac836575116e/src/core/lombok/core/configuration/LogDeclaration.java#L49-L85","documentation":"While parsing a custom logger declaration, each parameter definition list is classified as including TOPIC or not. At most one list may include TOPIC; a second one throws IllegalArgumentException naming both conflicting lists.","triggerScenarios":"LogDeclaration.valueOf with a declaration whose parameter section contains two or more alternative parameter lists that each include TOPIC, e.g. 'create(TOPIC)(TOPIC, TYPE)' — the pattern's parenthesized groups separated by '|'.","commonSituations":"Writing multi-signature custom logger declarations where several overloads accidentally all declare TOPIC, instead of varying only the non-topic part.","solutions":["Keep at most one parameter list containing TOPIC; move optional extras (TYPE) into the other list or remove duplicates.","Express overload variety via the non-TOPIC lists only.","Validate the declaration against the pattern before saving it to lombok.config."],"exampleFix":"// before\nlombok.log.customDeclaration = com.acme.F.create(TOPIC)(TOPIC,TYPE)\n// after\nlombok.log.customDeclaration = com.acme.F.create(TOPIC)(TYPE)","handlingStrategy":"validation","validationCode":"int topicLists = 0;\n// for each parenthesized param group: if (group.contains(\"TOPIC\")) topicLists++;\nboolean valid = topicLists <= 1;","typeGuard":null,"tryCatchPattern":"try {\n  LogDeclaration decl = LogDeclaration.valueOf(cfgValue);\n} catch (IllegalArgumentException e) {\n  // reduce duplicate TOPIC groups and retry once\n}","preventionTips":["Keep at most one alternative parameter list containing TOPIC.","Vary overloads only in non-TOPIC entries.","Review the declaration string for duplicated parenthesized groups."],"tags":["lombok","configuration","logging"],"backgroundTag":"conflicting-config-options","analyzedSha":"6d6a3e9fec0a9555702561fbeb8eac836575116e","analyzedAt":"2026-09-07T23:18:01.841Z","contentChangedAt":"2026-09-07T23:18:01.841Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}