Github user pvillard31 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2787#discussion_r194632391
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutEmail.java
 ---
    @@ -319,6 +330,15 @@ public void onTrigger(final ProcessContext context, 
final ProcessSession session
                 message.setRecipients(RecipientType.CC, 
toInetAddresses(context, flowFile, CC));
                 message.setRecipients(RecipientType.BCC, 
toInetAddresses(context, flowFile, BCC));
     
    +            final String attributeNameRegex = 
context.getProperty(ATTRIBUTE_NAME_REGEX).getValue();
    +            final Pattern attributeNamePattern = attributeNameRegex == 
null ? null : Pattern.compile(attributeNameRegex);
    --- End diff --
    
    Could we move the compile outside the onTrigger call? I think it's better 
to make this call when the processor is scheduled.


---

Reply via email to