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:45:20 UTC
[plc4x] 01/04: - 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 develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit 288fc15624996120f4e04d6d8921fb9e6850dad5
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;
}