DBHandler: add @Nullable / @NonNull annotations

This commit is contained in:
Thomas Kuehne
2026-06-01 03:43:08 +00:00
parent 7a986ee5e7
commit bd829ce33b
2 changed files with 10 additions and 5 deletions
@@ -18,6 +18,8 @@ package nodomain.freeyourgadget.gadgetbridge;
import android.database.sqlite.SQLiteDatabase;
import androidx.annotation.NonNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -65,12 +67,14 @@ public class LockHandler implements DBHandler {
lock.unlock();
}
@NonNull
@Override
public DaoSession getDaoSession() {
ensureNotClosed();
return session;
}
@NonNull
@Override
public SQLiteDatabase getDatabase() {
ensureNotClosed();
@@ -1,5 +1,5 @@
/* Copyright (C) 2015-2024 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, JohnnySun
/* Copyright (C) 2015-2026 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, JohnnySun, Thomas Kuehne
This file is part of Gadgetbridge.
@@ -19,16 +19,17 @@ package nodomain.freeyourgadget.gadgetbridge.database;
import android.database.sqlite.SQLiteDatabase;
import androidx.annotation.NonNull;
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
/**
* Provides low-level access to the database.
*/
public interface DBHandler extends AutoCloseable {
@Override
void close() throws Exception;
@NonNull
SQLiteDatabase getDatabase();
@NonNull
DaoSession getDaoSession();
}