fix: handle IllegalArgumentException for stale portlet URLs#2924
Merged
bjagg merged 2 commits intoMar 19, 2026
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>
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
rel-5-17-patches) forward tomastergetPortletWindowId()call inparsePortletParameterName()with try-catch forIllegalArgumentException, matching the existing pattern inparsePortletWindowIdSuffix()and the delegate mapping handlerClassicMaxInactiveStrategyandPersonalizerImplContext
Stale/bookmarked URLs referencing deleted portlet definitions (e.g.
pCa=27_ctf9_142032where portlet def27no longer exists) cause an unhandledIllegalArgumentExceptionthat propagates toExceptionLoggingFilterand returns a 500 to the user. The fix catches this gracefully — logs a warning and continues rendering the page without the stale portlet reference.Test plan
UrlSyntaxProviderImplTestupdated with test for stale portlet entity IDs🤖 Generated with Claude Code