WW-4421 Fix duplicate @Action annotation check being skipped#1579
Open
lukaszlenart wants to merge 1 commit intomainfrom
Open
WW-4421 Fix duplicate @Action annotation check being skipped#1579lukaszlenart wants to merge 1 commit intomainfrom
lukaszlenart wants to merge 1 commit intomainfrom
Conversation
…) is annotated The duplicate @action name detection in PackageBasedActionConfigBuilder was embedded inside a conditional block that only ran when execute() was NOT annotated with @action. This meant two methods could map to the same action name silently when execute() had an @action annotation, with one overwriting the other non-deterministically. Extract the duplicate check to run unconditionally before the conditional block, so it applies to all annotated methods regardless of whether execute() is annotated. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
99e4d49 to
7770119
Compare
|
kusalk
approved these changes
Feb 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
@Actionname detection being skipped whenexecute()is annotated with@ActionPackageBasedActionConfigBuilder.buildConfiguration()Fixes WW-4421
Problem
The duplicate
@Actionname detection inPackageBasedActionConfigBuilder.buildConfiguration()was embedded inside a conditional block (!map.containsKey(DEFAULT_METHOD)) whose primary purpose is deciding whether to auto-create a mapping forexecute(). Whenexecute()is annotated with@Action, the condition isfalseand the entire duplicate detection is skipped — silently allowing two methods to map to the same action name, with one overwriting the other non-deterministically.Changes
PackageBasedActionConfigBuilder.java— Moved theactionNamesduplicate check loop before theif (!map.containsKey(DEFAULT_METHOD) ...)block so it runs for all annotated methods regardless ofexecute()annotation status.Test fixtures:
DuplicateActionNameWithExecuteAnnotationAction—@Action("duplicate")on bothexecute()and another method (the previously undetected case)DuplicateActionNameWithoutExecuteAnnotationAction— unannotatedexecute()with two methods sharing@Action("duplicate")(regression guard)PackageBasedActionConfigBuilderTest.java— Two new test methods verifyingConfigurationExceptionis thrown in both scenarios.Test plan
testDuplicateActionNameWithAnnotatedExecutepasses (new — validates the fix)testDuplicateActionNameWithoutAnnotatedExecutepasses (regression guard)🤖 Generated with Claude Code