Fix some iffy parameter type converions by nielsm5 · Pull Request #10143 · frankframework/frankframework
| registerSubstitute(entry.getKey(), cleanseValue(entry.getValue())); | ||
| } | ||
| } | ||
|
|
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
V in this case is a parameter map with may (or more certainly does) contain Message's.
| throw Lombok.sneakyThrow(new SenderException("unable to read parameter [" + e.getKey() + "]", ex)); | ||
| } | ||
| } | ||
| return (String) e.getValue(); |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very strange casts... Right now at least it will always be a String (a look a lot cleaner).
| 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); |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handy a method that takes an Object...
| private V cleanseValue(V value) { | ||
| if (value instanceof Message message) { | ||
| try { | ||
| return (V) message.asString(); |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, viel veel om toen ik het weg probeerde te poetsen...
nielsm5
deleted the
bug/parameter-return-types
branch
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