dan-s1 commented on code in PR #10238:
URL: https://github.com/apache/nifi/pull/10238#discussion_r2304469545


##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/ExtensionBuilder.java:
##########
@@ -507,6 +509,10 @@ private ProcessorNode createProcessorNode(final 
LoggableComponent<Processor> pro
        applyDefaultSettings(procNode);
        applyDefaultRunDuration(procNode);
 
+       final Stateful stateful = 
processor.getComponent().getClass().getAnnotation(Stateful.class);
+       final boolean dropStateKeySupported = stateful != null && 
stateful.dropStateKeySupported();

Review Comment:
   These lines are duplicated five time in this class. I think it would be 
worthwhile to create a reusable method to return a boolean which you could 
assign to the `dropStateKeySupported` variable. e.g. for the method would be
   
   ```
   private boolean isDropStateKeySupported(final ConfigurableComponent 
configurableComponent) {
          final Stateful stateful = 
configurableComponent.getClass().getAnnotation(Stateful.class);
          return stateful != null && stateful.dropStateKeySupported();
      }
      }
   ```
   



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