You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2020/02/24 08:44:17 UTC

[plc4x] 01/06: - Fixed a problem only occurring when trying to configure something that is not configurable

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/luxtronik2-driver
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 74d42be99da613b7d6ea4639b33e90d54bb431d1
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Mon Feb 24 09:20:06 2020 +0100

    - Fixed a problem only occurring when trying to configure something that is not configurable
---
 .../apache/plc4x/java/spi/configuration/ConfigurationFactory.java    | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/configuration/ConfigurationFactory.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/configuration/ConfigurationFactory.java
index fe272e9..668e830 100644
--- a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/configuration/ConfigurationFactory.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/configuration/ConfigurationFactory.java
@@ -133,11 +133,10 @@ public class ConfigurationFactory {
                 .map(type -> ((ParameterizedType) type))
                 .filter(type -> type.getRawType().equals(HasConfiguration.class))
                 .findAny();
-            if (!typeOptional.isPresent()) {
-                throw new IllegalStateException("This should never happen!");
+            if (typeOptional.isPresent()) {
+                ((HasConfiguration) obj).setConfiguration(configuration);
             }
 
-            ((HasConfiguration) obj).setConfiguration(configuration);
         }
         return obj;
     }