diff --git a/bundles/org.openhab.persistence.mapdb/src/main/java/org/openhab/persistence/mapdb/internal/StateTypeAdapter.java b/bundles/org.openhab.persistence.mapdb/src/main/java/org/openhab/persistence/mapdb/internal/StateTypeAdapter.java index c650fcf5052..eadd8469ddf 100644 --- a/bundles/org.openhab.persistence.mapdb/src/main/java/org/openhab/persistence/mapdb/internal/StateTypeAdapter.java +++ b/bundles/org.openhab.persistence.mapdb/src/main/java/org/openhab/persistence/mapdb/internal/StateTypeAdapter.java @@ -43,11 +43,12 @@ public class StateTypeAdapter extends TypeAdapter { return null; } String value = reader.nextString(); - String[] parts = value.split(TYPE_SEPARATOR); - String valueTypeName = parts[0]; - String valueAsString = parts[1]; try { + String[] parts = value.split(TYPE_SEPARATOR); + String valueTypeName = parts[0]; + String valueAsString = parts[1]; + @SuppressWarnings("unchecked") Class valueType = (Class) Class.forName(valueTypeName); List> types = Collections.singletonList(valueType);