fix: handle IllegalArgumentException for stale portlet URLs#2916
Merged
Naenyn merged 5 commits intoMar 16, 2026
Merged
Conversation
…ortletParameterName When a portlet is removed but a user still has a stale URL referencing it, UrlSyntaxProviderImpl.parsePortletParameterName throws an unhandled IllegalArgumentException from portletWindowRegistry.getPortletWindowId(), resulting in a 500 error. This wraps the call in a try-catch to match the existing pattern in parsePortletWindowIdSuffix, logging a warning and gracefully ignoring the stale parameter. Also re-enables UrlSyntaxProviderImplTest (was @ignore'd) and adds tests covering both parsePortletParameterName and parsePortletWindowIdSuffix with invalid portlet entities. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Naenyn
approved these changes
Mar 16, 2026
2 tasks
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.
Checklist
security.propertiesportal.propertiesCHANGES.mdDescription of change
When a portlet is removed but a user still has a stale URL referencing it (e.g. from a bookmarked or cached page),
UrlSyntaxProviderImpl.parsePortletParameterName()throws an unhandledIllegalArgumentExceptionfromportletWindowRegistry.getPortletWindowId(), resulting in a 500 error for the user.This fix wraps the call in a try-catch for
IllegalArgumentException, matching the existing defensive pattern already used in the sibling methodparsePortletWindowIdSuffix(). On failure, a warning is logged and the stale parameter is gracefully ignored.Changes:
UrlSyntaxProviderImpl.parsePortletParameterName()— added try-catch aroundgetPortletWindowId()callUrlSyntaxProviderImplTest— removed@Ignoreannotation, switched toMockitoJUnitRunner.Silent, added two tests covering bothparsePortletParameterNameandparsePortletWindowIdSuffixwith invalid/stale portlet entity IDs🤖 Generated with Claude Code