projectlombok/lombok · error · IllegalArgumentException
There is more than one parameter definition that includes…
Error message
There is more than one parameter definition that includes TOPIC:
What it means
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.
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.
Example fix
// before lombok.log.customDeclaration = com.acme.F.create(TOPIC)(TOPIC,TYPE) // after lombok.log.customDeclaration = com.acme.F.create(TOPIC)(TYPE)
Defensive patterns
Strategy: validation
Validate before calling
int topicLists = 0;
// for each parenthesized param group: if (group.contains("TOPIC")) topicLists++;
boolean valid = topicLists <= 1; Try / catch
try {
LogDeclaration decl = LogDeclaration.valueOf(cfgValue);
} catch (IllegalArgumentException e) {
// reduce duplicate TOPIC groups and retry once
} Prevention
- Keep at most one alternative parameter list containing TOPIC.
- Vary overloads only in non-TOPIC entries.
- Review the declaration string for duplicated parenthesized groups.
When it happens
Trigger: 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 '|'.
Common situations: Writing multi-signature custom logger declarations where several overloads accidentally all declare TOPIC, instead of varying only the non-topic part.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- The declaration must follow the pattern: [LoggerType…
- There is more than one parmaeter definition that does not…
- No logger factory method parameters specified.
- Minor version must be between 0 and 999
- Lombok supports at most v
AI-assisted analysis of projectlombok/lombok@6d6a3e9fec (2026-09-07).
Data as JSON: /api/errors/7fb8a931cbab1281.
Report an issue: GitHub.
Appendix: source
Thrown at src/core/lombok/core/configuration/LogDeclaration.java:67
}
public static LogDeclaration valueOf(String declaration) {
if (declaration == null) return null;
Matcher matcher = DECLARATION_PATTERN.matcher(declaration);
if (!matcher.matches()) throw new IllegalArgumentException("The declaration must follow the pattern: [LoggerType ]LoggerFactoryType.loggerFactoryMethod(loggerFactoryMethodParams)[(loggerFactoryMethodParams)]");
TypeName loggerFactoryType = TypeName.valueOf(matcher.group(2));
TypeName loggerType = TypeName.valueOf(matcher.group(1));
if (loggerType == null) loggerType = loggerFactoryType;
IdentifierName loggerFactoryMethod = IdentifierName.valueOf(matcher.group(3));
List<List<LogFactoryParameter>> allParameters = parseParameters(matcher.group(4));
List<LogFactoryParameter> parametersWithoutTopic = null;
List<LogFactoryParameter> parametersWithTopic = null;
for (List<LogFactoryParameter> parameters: allParameters) {
if (parameters.contains(LogFactoryParameter.TOPIC)) {
if (parametersWithTopic != null) throw new IllegalArgumentException("There is more than one parameter definition that includes TOPIC: " + parametersWithTopic + " and " + parameters);
parametersWithTopic = parameters;
} else {
if (parametersWithoutTopic != null) throw new IllegalArgumentException("There is more than one parmaeter definition that does not include TOPIC: " + parametersWithoutTopic + " and " + parameters);
parametersWithoutTopic = parameters;
}
}
// sanity check (the pattern should disallow this situation
if (parametersWithoutTopic == null && parametersWithTopic == null) throw new IllegalArgumentException("No logger factory method parameters specified.");
return new LogDeclaration(loggerType, loggerFactoryType, loggerFactoryMethod, parametersWithoutTopic, parametersWithTopic);
}
private static List<List<LogFactoryParameter>> parseParameters(String parametersDefinitions) {
List<List<LogFactoryParameter>> allParameters = new ArrayList<List<LogFactoryParameter>>();
Matcher matcher = PARAMETERS_PATTERN.matcher(parametersDefinitions);
while (matcher.find()) {
String parametersDefinition = matcher.group(1);View on GitHub (pinned to 6d6a3e9fec)