Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARTEMIS-4926 throw checked URISyntaxException on bad URL #5452

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

jbertram
Copy link
Contributor

No description provided.

Comment on lines 153 to 154
ActiveMQUtilLogger.LOGGER.unableToParseURLParameterName(parameter.substring(0, p), e);
continue;
Copy link
Member

Choose a reason for hiding this comment

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

Catching and continuing does not actually seem like an improvement to me at all. Personally, I would want it to throw rather than just continue and perhaps do something quite different than I had perhaps intended.

The original complaint seems to be more that this sub-method can throw IAE and the calling methods dont handle that explicitly, or declare so. Feels like they could as easily just declare it throws IAE, or even perhaps wrap with URISyntaxException.

If taking that approach, this could just call parseParameters(URI uri) per the original report and check behviour, rather than exposing this private method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's fair. See my latest push.

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks good to me. I had similar thoughts on the original changes as Robbie did, I would generally expect things to fail than to suppress errors and lead people to think configuration was applied when it was not.

@jbertram jbertram changed the title ARTEMIS-4926 handled bad URL parameter names & values gracefully ARTEMIS-4926 throw checked URISyntaxException on bad URL Jan 22, 2025
@gemmellr gemmellr merged commit 33d064d into apache:main Jan 23, 2025
6 checks passed
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.

3 participants