Skip to content

GH-1964 - Report duplicate application module identifiers with descriptive error message - #1965

Open
abhiramaab wants to merge 1 commit into
spring-projects:mainfrom
abhiramaab:gh-1964
Open

abhiramaab wants to merge 1 commit into
spring-projects:mainfrom
abhiramaab:gh-1964

Conversation

@abhiramaab

Copy link
Copy Markdown

When two or more application modules resolve to the same module identifier, ApplicationModules previously threw a generic JDK IllegalStateException: Duplicate key ... from Collectors.toMap(...), dumping raw multi-line module strings without indicating which packages collided or how to resolve the conflict.

This commit groups detected modules by identifier and validates uniqueness before building the internal module map. If any duplicate identifier is found, it throws a descriptive IllegalStateException listing the colliding base packages in alphabetical order and suggesting resolution options (@ApplicationModule(id = …) or @Modulithic(useFullyQualifiedModuleNames = true)).

Includes reproducer unit tests in ApplicationModulesUnitTests.

Closes gh-1964.

…ers with descriptive error message.

Closes spring-projectsgh-1964.

Signed-off-by: Abhirama <abhiram.b@icloud.com>
Copilot AI balanced review requested due to automatic review settings October 15, 2026 18:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@abhiramaab
abhiramaab requested a balanced review from Copilot October 17, 2026 11:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report duplicate application module identifiers with a descriptive error message

2 participants