zzzk1 commented on code in PR #6354:
URL: https://github.com/apache/gravitino/pull/6354#discussion_r1926141324
##########
server-common/src/main/java/org/apache/gravitino/server/authentication/KerberosServerUtils.java:
##########
@@ -353,11 +354,7 @@ DER get(int... tags) {
}
String getAsString() {
- try {
- return new String(bb.array(), bb.arrayOffset() + bb.position(),
bb.remaining(), "UTF-8");
- } catch (UnsupportedEncodingException e) {
- throw new IllegalCharsetNameException("UTF-8"); // won't happen.
- }
Review Comment:
> Why did you remove this code?
The String constructor used here does not declare that it throws an
`UnsupportedEncodingException` because `StandardCharsets.UTF_8` guarantees that
the encoding is supported. However, an `IndexOutOfBoundsException` could occur
in this context.
--
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]