anujmodi2021 commented on code in PR #5535:
URL: https://github.com/apache/hadoop/pull/5535#discussion_r1158539279
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/security/TokenUtils.java:
##########
@@ -40,10 +39,10 @@ private TokenUtils() {
public static Token<DelegationTokenIdentifier> toDelegationToken(
final Map<?, ?> inputMap) throws IOException {
final Map<?, ?> m = (Map<?, ?>) inputMap.get(Token.class.getSimpleName());
- return (Token<DelegationTokenIdentifier>) toToken(m);
+ return toToken(m);
}
- public static Token<? extends TokenIdentifier> toToken(final Map<?, ?> m)
+ public static Token<DelegationTokenIdentifier> toToken(final Map<?, ?> m)
Review Comment:
The only possible return type from this function (apart from null) is
Token<DelegationTokenIdentifier>. Therefore it seems safe to deterministically
define the return type instead of generic return type here. This will solve the
Unchecked Cast Error.
--
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]