mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-25 14:55:55 +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;
|
return null;
|
||||||
}
|
}
|
||||||
String value = reader.nextString();
|
String value = reader.nextString();
|
||||||
|
|
||||||
|
try {
|
||||||
String[] parts = value.split(TYPE_SEPARATOR);
|
String[] parts = value.split(TYPE_SEPARATOR);
|
||||||
String valueTypeName = parts[0];
|
String valueTypeName = parts[0];
|
||||||
String valueAsString = parts[1];
|
String valueAsString = parts[1];
|
||||||
|
|
||||||
try {
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Class<? extends State> valueType = (Class<? extends State>) Class.forName(valueTypeName);
|
Class<? extends State> valueType = (Class<? extends State>) Class.forName(valueTypeName);
|
||||||
List<Class<? extends State>> types = Collections.singletonList(valueType);
|
List<Class<? extends State>> types = Collections.singletonList(valueType);
|
||||||
|
Loading…
Reference in New Issue
Block a user