sruehl commented on a change in pull request #305:
URL: https://github.com/apache/plc4x/pull/305#discussion_r789702016



##########
File path: plc4j/spi/pom.xml
##########
@@ -48,10 +48,6 @@
       <artifactId>netty-transport</artifactId>
     </dependency>
 
-    <dependency>

Review comment:
       please check if upstream can fix that.

##########
File path: 
plc4j/spi/src/main/java/org/apache/plc4x/java/spi/configuration/ConfigurationFactory.java
##########
@@ -161,80 +150,107 @@ private static String getConfigurationName(Field field) {
     }
 
     /**
-     * Convert the string value from the parameter string into the type the 
field requires.
+     * Set the instance field value.
      *
+     * @param instance    instance that should be set
      * @param field       field that should be set
      * @param valueString string representation of the value
-     * @return parsed value of the field in the type the field requires
      */
-    private static Object toFieldValue(Field field, String valueString) {
+    private static void setFieldValue(Object instance, Field field, String 
valueString) throws IllegalAccessException {
         if (field == null) {
             throw new IllegalArgumentException("Field not defined");
         }
 
-        if (field.getAnnotation(ParameterConverter.class) != null) {
-            Class<? extends ConfigurationParameterConverter<?>> converterClass 
= field.getAnnotation(ParameterConverter.class).value();
+        try {
+            // Make the field accessible
+            field.setAccessible(true);

Review comment:
       if upstream disapproves we should at least use commons FieldUtils here




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