lasdf1234 commented on code in PR #11294:
URL: https://github.com/apache/gravitino/pull/11294#discussion_r3356209073


##########
bundles/aws/src/main/java/org/apache/gravitino/s3/credential/AwsIrsaCredentialGenerator.java:
##########
@@ -81,10 +81,12 @@ public AwsIrsaCredential generate(CredentialContext 
context) {
       AwsCredentials creds = baseCredentialsProvider.resolveCredentials();
       if (creds instanceof AwsSessionCredentials) {
         AwsSessionCredentials sessionCreds = (AwsSessionCredentials) creds;
-        long expiration =
-            sessionCreds.expirationTime().isPresent()
-                ? sessionCreds.expirationTime().get().toEpochMilli()
-                : 0L;
+        if (!sessionCreds.expirationTime().isPresent()) {

Review Comment:
   Thanks for the suggestion. Optional.isEmpty() would read better, but we 
can’t use it in this module.
   
   :bundles:aws is built as Java 8–compatible bytecode (release 8 via 
compatibleWithJDK8() in the root build.gradle.kts; :bundles is in 
jdk8CompatibleProjectPathPrefixes). Optional.isEmpty() was added in Java 11, so 
using it here would break compilation under our current Java 8 target.



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