mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[mapdb] Avoid ArrayIndexOutOfBoundsExceptions being thrown (#8792)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
This commit is contained in:
parent
42d1c26912
commit
5cca30492b
@ -43,11 +43,12 @@ public class StateTypeAdapter extends TypeAdapter<State> {
|
||||
return null;
|
||||
}
|
||||
String value = reader.nextString();
|
||||
|
||||
try {
|
||||
String[] parts = value.split(TYPE_SEPARATOR);
|
||||
String valueTypeName = parts[0];
|
||||
String valueAsString = parts[1];
|
||||
|
||||
try {
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<? extends State> valueType = (Class<? extends State>) Class.forName(valueTypeName);
|
||||
List<Class<? extends State>> types = Collections.singletonList(valueType);
|
||||
|
Loading…
Reference in New Issue
Block a user