Skip to content

fix: handle IllegalArgumentException for stale portlet URLs#2916

Merged
Naenyn merged 5 commits into
uPortal-Project:rel-5-17-patchesfrom
bjagg:fix/stale-portlet-url-error
Mar 16, 2026
Merged

fix: handle IllegalArgumentException for stale portlet URLs#2916
Naenyn merged 5 commits into
uPortal-Project:rel-5-17-patchesfrom
bjagg:fix/stale-portlet-url-error

Conversation

@bjagg

@bjagg bjagg commented Feb 14, 2026

Copy link
Copy Markdown
Member
Checklist
  • the individual contributor license agreement is signed
  • commit message follows commit guidelines
  • tests are included
  • documentation is changed or added
  • new security keys and comments added to security.properties
  • new general keys and comments added to portal.properties
  • any changes that impact configuration or the database DDL added to CHANGES.md
  • message properties have been updated with new phrases
  • view conforms with WCAG 2.0 AA
Description 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 unhandled IllegalArgumentException from portletWindowRegistry.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 method parsePortletWindowIdSuffix(). On failure, a warning is logged and the stale parameter is gracefully ignored.

Changes:

  • UrlSyntaxProviderImpl.parsePortletParameterName() — added try-catch around getPortletWindowId() call
  • UrlSyntaxProviderImplTest — removed @Ignore annotation, switched to MockitoJUnitRunner.Silent, added two tests covering both parsePortletParameterName and parsePortletWindowIdSuffix with invalid/stale portlet entity IDs

🤖 Generated with Claude Code

bjagg and others added 4 commits April 15, 2025 11:57
…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>
@bjagg bjagg requested a review from Naenyn February 14, 2026 22:25
@bjagg bjagg self-assigned this Feb 14, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Naenyn Naenyn merged commit 85f4983 into uPortal-Project:rel-5-17-patches Mar 16, 2026
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.

2 participants