exceptionfactory commented on code in PR #6743:
URL: https://github.com/apache/nifi/pull/6743#discussion_r1037308056


##########
nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-shared/src/main/java/org/apache/nifi/kafka/shared/property/provider/StandardKafkaPropertyNameProvider.java:
##########
@@ -58,9 +59,12 @@ private static Set<String> getCommonPropertyNames() {
         final Set<String> propertyNames = new LinkedHashSet<>();
 
         for (final String propertyClassName : PROPERTY_CLASSES) {
-            final Class<?> propertyClass = getClass(propertyClassName);
-            final Set<String> classPropertyNames = 
getStaticStringPropertyNames(propertyClass);
-            propertyNames.addAll(classPropertyNames);
+            final Optional<Class<?>> propertyClassFound = 
findClass(propertyClassName);
+            if (propertyClassFound.isPresent()) {
+                final Class<?> propertyClass = propertyClassFound.get();
+                final Set<String> classPropertyNames = 
getStaticStringPropertyNames(propertyClass);
+                propertyNames.addAll(classPropertyNames);
+            }

Review Comment:
   This is a best effort approach, based on Kafka classes available at runtime. 
This influences the custom property validation, so any issues would be flagged 
as validation problems. For that reason, adding logging here seems unnecessary.



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