Fix some iffy parameter type converions#10143
Merged
nielsm5 merged 1 commit intorelease/9.3from Dec 13, 2025
Merged
Conversation
nielsm5
commented
Dec 12, 2025
| registerSubstitute(entry.getKey(), cleanseValue(entry.getValue())); | ||
| } | ||
| } | ||
|
|
Member
Author
There was a problem hiding this comment.
V in this case is a parameter map with may (or more certainly does) contain Message's.
nielsm5
commented
Dec 12, 2025
| throw Lombok.sneakyThrow(new SenderException("unable to read parameter [" + e.getKey() + "]", ex)); | ||
| } | ||
| } | ||
| return (String) e.getValue(); |
Member
Author
There was a problem hiding this comment.
Very strange casts... Right now at least it will always be a String (a look a lot cleaner).
nielsm5
commented
Dec 12, 2025
| Object sharedSecretParam = parameterMap.remove(SHARED_SECRET_PARAMETER_NAME); //Remove the SharedKey, else it will be added as a JWT Claim | ||
| Map<String, Object> parameterMap = getSanitizedParameterValueMap(message, session); | ||
| Object sharedSecretParam = parameterMap.remove(SHARED_SECRET_PARAMETER_NAME); // Remove the SharedKey, else it will be added as a JWT Claim | ||
| parameterMap.forEach(claimsSetBuilder::claim); |
Member
Author
There was a problem hiding this comment.
Handy a method that takes an Object...
tnleeuw
approved these changes
Dec 12, 2025
| private V cleanseValue(V value) { | ||
| if (value instanceof Message message) { | ||
| try { | ||
| return (V) message.asString(); |
Contributor
There was a problem hiding this comment.
Die cast ziet er erg lelijk uit.
Nou is het type van <V> in de praktijk altijd en alleen maar Object dus het gaat nooit fout ... maar toch. Lelijk.
Member
Author
There was a problem hiding this comment.
I know, viel veel om toen ik het weg probeerde te poetsen...
tnleeuw
approved these changes
Dec 12, 2025
|
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.



No description provided.