dxbjavid commented on PR #749:
URL: https://github.com/apache/commons-text/pull/749#issuecomment-4616374496

   had a proper read through the package before replying. on bad input the 
lookups split into two camps:
   
   - value transforms that squelch to null so the interpolator can fall through 
to a default: base64Decoder/base64Encoder via FunctionStringLookup (catches 
IllegalArgumentException), resourceBundle (MissingResourceException), dns and 
inetAddress (UnknownHostException), constant (Exception).
   - operational lookups that deliberately surface failures as 
IllegalArgumentException: script, url, file, properties, xml. those load or run 
something so propagating reads as correct, and i've left all of them untouched.
   
   urlDecoder belongs in the first camp next to its closest sibling 
base64Decoder, which already returns null on malformed input. at the moment 
it's the odd one out: it handles the UnsupportedEncodingException path but lets 
URLDecoder.decode's IllegalArgumentException on a bad percent-escape 
(${urlDecoder:%}) propagate straight out of StringSubstitutor.replace, whereas 
${base64Decoder:!} just resolves to nothing. the patch only brings urlDecoder 
in line with that, so nothing in the propagate camp changes.
   
   i also checked urlEncoder for symmetry, but URLEncoder.encode doesn't throw 
IllegalArgumentException on arbitrary input so it doesn't need the same guard.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to