[persistence] Use Java 17 features (#15486)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user