[persistence] Use Java 17 features (#15486)

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
Holger Friedrich
2023-08-26 08:56:27 +02:00
committed by GitHub
parent 5b42c4b071
commit 1cf57e7dfe
18 changed files with 118 additions and 107 deletions

View File

@@ -101,8 +101,7 @@ public class MapDbPersistenceService implements QueryablePersistenceService {
map = db.createTreeMap("itemStore").makeOrGet();
} catch (RuntimeException re) {
Throwable cause = re.getCause();
if (cause instanceof ClassNotFoundException) {
ClassNotFoundException cnf = (ClassNotFoundException) cause;
if (cause instanceof ClassNotFoundException cnf) {
logger.warn(
"The MapDB in {} is incompatible with openHAB {}: {}. A new and empty MapDB will be used instead.",
dbFile, OpenHAB.getVersion(), cnf.getMessage());