[automerger] Merge "Add missing nullability annotations" into oc-mr1-support-27.0-dev am: 1ce0a406f9 am: 99f5c6c09a
Change-Id: I8ee8c786fc3889551232d29a01301a7007a15d05
diff --git a/lifecycle/common/src/main/java/android/arch/lifecycle/Lifecycle.java b/lifecycle/common/src/main/java/android/arch/lifecycle/Lifecycle.java
index c0a2090..e04cdb4 100644
--- a/lifecycle/common/src/main/java/android/arch/lifecycle/Lifecycle.java
+++ b/lifecycle/common/src/main/java/android/arch/lifecycle/Lifecycle.java
@@ -108,6 +108,7 @@
* @return The current state of the Lifecycle.
*/
@MainThread
+ @NonNull
public abstract State getCurrentState();
@SuppressWarnings("WeakerAccess")
diff --git a/lifecycle/runtime/src/main/java/android/arch/lifecycle/LifecycleRegistry.java b/lifecycle/runtime/src/main/java/android/arch/lifecycle/LifecycleRegistry.java
index bf8aff7..eff946b 100644
--- a/lifecycle/runtime/src/main/java/android/arch/lifecycle/LifecycleRegistry.java
+++ b/lifecycle/runtime/src/main/java/android/arch/lifecycle/LifecycleRegistry.java
@@ -225,6 +225,7 @@
return mObserverMap.size();
}
+ @NonNull
@Override
public State getCurrentState() {
return mState;
diff --git a/room/runtime/src/main/java/android/arch/persistence/room/RoomDatabase.java b/room/runtime/src/main/java/android/arch/persistence/room/RoomDatabase.java
index 8c94024..2a108f9 100644
--- a/room/runtime/src/main/java/android/arch/persistence/room/RoomDatabase.java
+++ b/room/runtime/src/main/java/android/arch/persistence/room/RoomDatabase.java
@@ -90,7 +90,7 @@
* @param configuration The database configuration.
*/
@CallSuper
- public void init(DatabaseConfiguration configuration) {
+ public void init(@NonNull DatabaseConfiguration configuration) {
mOpenHelper = createOpenHelper(configuration);
mCallbacks = configuration.callbacks;
mAllowMainThreadQueries = configuration.allowMainThreadQueries;
@@ -101,6 +101,7 @@
*
* @return The SQLite open helper used by this database.
*/
+ @NonNull
public SupportSQLiteOpenHelper getOpenHelper() {
return mOpenHelper;
}
@@ -113,6 +114,7 @@
* @param config The configuration of the Room database.
* @return A new SupportSQLiteOpenHelper to be used while connecting to the database.
*/
+ @NonNull
protected abstract SupportSQLiteOpenHelper createOpenHelper(DatabaseConfiguration config);
/**
@@ -122,6 +124,7 @@
*
* @return Creates a new InvalidationTracker.
*/
+ @NonNull
protected abstract InvalidationTracker createInvalidationTracker();
/**
@@ -199,7 +202,7 @@
* @param sql The query to compile.
* @return The compiled query.
*/
- public SupportSQLiteStatement compileStatement(String sql) {
+ public SupportSQLiteStatement compileStatement(@NonNull String sql) {
assertNotMainThread();
return mOpenHelper.getWritableDatabase().compileStatement(sql);
}
@@ -238,7 +241,7 @@
*
* @param body The piece of code to execute.
*/
- public void runInTransaction(Runnable body) {
+ public void runInTransaction(@NonNull Runnable body) {
beginTransaction();
try {
body.run();
@@ -256,7 +259,7 @@
* @param <V> The type of the return value.
* @return The value returned from the {@link Callable}.
*/
- public <V> V runInTransaction(Callable<V> body) {
+ public <V> V runInTransaction(@NonNull Callable<V> body) {
beginTransaction();
try {
V result = body.call();
@@ -278,7 +281,7 @@
*
* @param db The database instance.
*/
- protected void internalInitInvalidationTracker(SupportSQLiteDatabase db) {
+ protected void internalInitInvalidationTracker(@NonNull SupportSQLiteDatabase db) {
mInvalidationTracker.internalInit(db);
}
@@ -290,6 +293,7 @@
*
* @return The invalidation tracker for the database.
*/
+ @NonNull
public InvalidationTracker getInvalidationTracker() {
return mInvalidationTracker;
}
@@ -365,7 +369,7 @@
* @return this
*/
@NonNull
- public Builder<T> addMigrations(Migration... migrations) {
+ public Builder<T> addMigrations(@NonNull Migration... migrations) {
mMigrationContainer.addMigrations(migrations);
return this;
}
@@ -471,7 +475,7 @@
*
* @param migrations List of available migrations.
*/
- public void addMigrations(Migration... migrations) {
+ public void addMigrations(@NonNull Migration... migrations) {
for (Migration migration : migrations) {
addMigration(migration);
}