turcsanyip commented on code in PR #10401:
URL: https://github.com/apache/nifi/pull/10401#discussion_r2578967985


##########
nifi-extension-bundles/nifi-standard-services/nifi-oauth2-provider-bundle/nifi-oauth2-provider-service/src/main/java/org/apache/nifi/oauth2/StandardOauth2AccessTokenProvider.java:
##########
@@ -456,8 +468,10 @@ private void getProperties(ConfigurationContext context) {
     }
 
     private boolean isRefreshRequired() {
+        final long expirationTime = 
Optional.ofNullable(accessDetails.getExpiresIn()).orElse(defaultExpirationTimeSeconds);

Review Comment:
   > The `Optional.ofNullable()` approach creates an unnecessary `Optional` 
wrapper. I recommend replacing this with a standard conditional
   
   I'm not a big fan of it, but I tend to use it. I don't insist on it at all.
   Just to avoid one more round: what do you think about a ternary operator? 
(no wrapper but still compact)
   I'm also fine with the regular `if-else` if that is preferable.



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