janhoy opened a new pull request, #4606:
URL: https://github.com/apache/solr/pull/4606

   Split out of the Error Prone 2.50.0 upgrade (#4604) per review feedback 
there: the `JdkObsolete` pattern flags charset-name `String` overloads, and 
this modernization changes exception behavior, so it deserves its own review.
   
   - Replaces `String` charset-name APIs (`new String(bytes, name)`, `new 
InputStreamReader(is, name)`, `URLEncoder.encode(s, name)`, ...) with their 
`Charset` overloads.
   - `Charset.forName()` throws unchecked `IllegalArgumentException` where the 
old APIs threw the checked `UnsupportedEncodingException`. Since the charset 
name often comes from a client-supplied Content-Type header, a new 
`ContentStreamBase.charsetForName()` helper converts it back to 
`UnsupportedEncodingException` so an invalid charset stays an I/O error instead 
of escaping as a runtime exception. `HttpSolrClient` catches 
`IllegalArgumentException` explicitly.
   - Removes now-dead `UnsupportedEncodingException` handling around 
compile-time-constant charsets (e.g. `SolrParams.toQueryString`).
   
   #4604 will suppress the corresponding `JdkObsolete` findings with TODO 
comments pointing here; once this merges, that branch drops the suppressions on 
rebase.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to