You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/06/23 14:56:46 UTC

[GitHub] [nifi] gresockj commented on a change in pull request #5179: NIFI-8630 Upgraded javax.mail 1.4.7 to jakarta.mail 2.0.1 for PutEmail

gresockj commented on a change in pull request #5179:
URL: https://github.com/apache/nifi/pull/5179#discussion_r657184122



##########
File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutEmail.java
##########
@@ -437,19 +431,18 @@ public void process(InputStream in) throws IOException {
      */
     private Session createMailSession(final Properties properties) {
         String authValue = properties.getProperty("mail.smtp.auth");

Review comment:
       I notice a few other local variables that are not final but could be.  What do you think about making them final in this PR?

##########
File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutEmail.java
##########
@@ -437,19 +431,18 @@ public void process(InputStream in) throws IOException {
      */
     private Session createMailSession(final Properties properties) {
         String authValue = properties.getProperty("mail.smtp.auth");
-        Boolean auth = Boolean.valueOf(authValue);
+        final boolean auth = Boolean.parseBoolean(authValue);
 
         /*
          * Conditionally create a password authenticator if the 'auth' parameter is set.
          */
-        final Session mailSession = auth ? Session.getInstance(properties, new Authenticator() {
+        return auth ? Session.getInstance(properties, new Authenticator() {
             @Override
             public PasswordAuthentication getPasswordAuthentication() {
                 String username = properties.getProperty("mail.smtp.user"), password = properties.getProperty("mail.smtp.password");

Review comment:
       Quaint use of the multi-variable declaration in the existing code -- how do you feel about splitting this into two lines?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org