Annotate some SQLite APIs for nullability
Test: none
Change-Id: Ib6329df6731b4eeca91bc3d03dc2fa09d918229f
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/SuspendingQueryTest.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/SuspendingQueryTest.kt
index 6c1b231..9d2ce74 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/SuspendingQueryTest.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/SuspendingQueryTest.kt
@@ -786,7 +786,7 @@
object : SupportSQLiteOpenHelper.Factory {
val factoryDelegate = FrameworkSQLiteOpenHelperFactory()
override fun create(
- configuration: SupportSQLiteOpenHelper.Configuration?
+ configuration: SupportSQLiteOpenHelper.Configuration
): SupportSQLiteOpenHelper {
val helperDelegate = factoryDelegate.create(configuration)
return object : SupportSQLiteOpenHelper by helperDelegate {
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/CustomDatabaseTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/CustomDatabaseTest.java
index 31d078d..77e9a7e 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/CustomDatabaseTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/CustomDatabaseTest.java
@@ -26,6 +26,7 @@
import android.database.sqlite.SQLiteException;
import android.os.SystemClock;
+import androidx.annotation.NonNull;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import androidx.room.integration.testapp.database.Customer;
@@ -76,8 +77,10 @@
*/
private static class RethrowExceptionFactory implements SupportSQLiteOpenHelper.Factory {
+ @NonNull
@Override
- public SupportSQLiteOpenHelper create(SupportSQLiteOpenHelper.Configuration configuration) {
+ public SupportSQLiteOpenHelper create(
+ @NonNull SupportSQLiteOpenHelper.Configuration configuration) {
final FrameworkSQLiteOpenHelperFactory factory = new FrameworkSQLiteOpenHelperFactory();
final SupportSQLiteOpenHelper helper = factory.create(configuration);
SupportSQLiteOpenHelper helperMock = mock(SupportSQLiteOpenHelper.class,
diff --git a/sqlite/sqlite-framework/api/2.1.0-alpha01.txt b/sqlite/sqlite-framework/api/2.1.0-alpha01.txt
index 9c05b84..a0f6163 100644
--- a/sqlite/sqlite-framework/api/2.1.0-alpha01.txt
+++ b/sqlite/sqlite-framework/api/2.1.0-alpha01.txt
@@ -3,7 +3,7 @@
public final class FrameworkSQLiteOpenHelperFactory implements androidx.sqlite.db.SupportSQLiteOpenHelper.Factory {
ctor public FrameworkSQLiteOpenHelperFactory();
- method public androidx.sqlite.db.SupportSQLiteOpenHelper! create(androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration!);
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper create(androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration);
}
}
diff --git a/sqlite/sqlite-framework/api/current.txt b/sqlite/sqlite-framework/api/current.txt
index 9c05b84..a0f6163 100644
--- a/sqlite/sqlite-framework/api/current.txt
+++ b/sqlite/sqlite-framework/api/current.txt
@@ -3,7 +3,7 @@
public final class FrameworkSQLiteOpenHelperFactory implements androidx.sqlite.db.SupportSQLiteOpenHelper.Factory {
ctor public FrameworkSQLiteOpenHelperFactory();
- method public androidx.sqlite.db.SupportSQLiteOpenHelper! create(androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration!);
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper create(androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration);
}
}
diff --git a/sqlite/sqlite-framework/api/restricted_2.1.0-alpha01.txt b/sqlite/sqlite-framework/api/restricted_2.1.0-alpha01.txt
index 9c05b84..a0f6163 100644
--- a/sqlite/sqlite-framework/api/restricted_2.1.0-alpha01.txt
+++ b/sqlite/sqlite-framework/api/restricted_2.1.0-alpha01.txt
@@ -3,7 +3,7 @@
public final class FrameworkSQLiteOpenHelperFactory implements androidx.sqlite.db.SupportSQLiteOpenHelper.Factory {
ctor public FrameworkSQLiteOpenHelperFactory();
- method public androidx.sqlite.db.SupportSQLiteOpenHelper! create(androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration!);
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper create(androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration);
}
}
diff --git a/sqlite/sqlite-framework/api/restricted_current.txt b/sqlite/sqlite-framework/api/restricted_current.txt
index 9c05b84..a0f6163 100644
--- a/sqlite/sqlite-framework/api/restricted_current.txt
+++ b/sqlite/sqlite-framework/api/restricted_current.txt
@@ -3,7 +3,7 @@
public final class FrameworkSQLiteOpenHelperFactory implements androidx.sqlite.db.SupportSQLiteOpenHelper.Factory {
ctor public FrameworkSQLiteOpenHelperFactory();
- method public androidx.sqlite.db.SupportSQLiteOpenHelper! create(androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration!);
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper create(androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration);
}
}
diff --git a/sqlite/sqlite-framework/lint-baseline.xml b/sqlite/sqlite-framework/lint-baseline.xml
index 6abcc27..95cca31 100644
--- a/sqlite/sqlite-framework/lint-baseline.xml
+++ b/sqlite/sqlite-framework/lint-baseline.xml
@@ -1,26 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="5" by="lint 3.5.0-beta04" client="gradle" variant="debug" version="3.5.0-beta04">
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
- errorLine1=" public SupportSQLiteOpenHelper create(SupportSQLiteOpenHelper.Configuration configuration) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/sqlite/db/framework/FrameworkSQLiteOpenHelperFactory.java"
- line="28"
- column="12"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
- errorLine1=" public SupportSQLiteOpenHelper create(SupportSQLiteOpenHelper.Configuration configuration) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/sqlite/db/framework/FrameworkSQLiteOpenHelperFactory.java"
- line="28"
- column="43"/>
- </issue>
+<issues format="5" by="lint 3.5.0-beta05" client="gradle" variant="all" version="3.5.0-beta05">
</issues>
diff --git a/sqlite/sqlite-framework/src/main/java/androidx/sqlite/db/framework/FrameworkSQLiteOpenHelperFactory.java b/sqlite/sqlite-framework/src/main/java/androidx/sqlite/db/framework/FrameworkSQLiteOpenHelperFactory.java
index e65fabe2..d27abee 100644
--- a/sqlite/sqlite-framework/src/main/java/androidx/sqlite/db/framework/FrameworkSQLiteOpenHelperFactory.java
+++ b/sqlite/sqlite-framework/src/main/java/androidx/sqlite/db/framework/FrameworkSQLiteOpenHelperFactory.java
@@ -16,6 +16,7 @@
package androidx.sqlite.db.framework;
+import androidx.annotation.NonNull;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
/**
@@ -24,8 +25,10 @@
*/
@SuppressWarnings("unused")
public final class FrameworkSQLiteOpenHelperFactory implements SupportSQLiteOpenHelper.Factory {
+ @NonNull
@Override
- public SupportSQLiteOpenHelper create(SupportSQLiteOpenHelper.Configuration configuration) {
+ public SupportSQLiteOpenHelper create(
+ @NonNull SupportSQLiteOpenHelper.Configuration configuration) {
return new FrameworkSQLiteOpenHelper(
configuration.context, configuration.name, configuration.callback);
}
diff --git a/sqlite/sqlite/api/2.1.0-alpha01.txt b/sqlite/sqlite/api/2.1.0-alpha01.txt
index 99d1651..f4688a2f 100644
--- a/sqlite/sqlite/api/2.1.0-alpha01.txt
+++ b/sqlite/sqlite/api/2.1.0-alpha01.txt
@@ -53,7 +53,7 @@
public interface SupportSQLiteOpenHelper extends java.io.Closeable {
method public void close();
- method public String! getDatabaseName();
+ method public String? getDatabaseName();
method public androidx.sqlite.db.SupportSQLiteDatabase! getReadableDatabase();
method public androidx.sqlite.db.SupportSQLiteDatabase! getWritableDatabase();
method @RequiresApi(api=android.os.Build.VERSION_CODES.JELLY_BEAN) public void setWriteAheadLoggingEnabled(boolean);
@@ -61,30 +61,30 @@
public abstract static class SupportSQLiteOpenHelper.Callback {
ctor public SupportSQLiteOpenHelper.Callback(int);
- method public void onConfigure(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public void onCorruption(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public abstract void onCreate(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public void onDowngrade(androidx.sqlite.db.SupportSQLiteDatabase!, int, int);
- method public void onOpen(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public abstract void onUpgrade(androidx.sqlite.db.SupportSQLiteDatabase!, int, int);
+ method public void onConfigure(androidx.sqlite.db.SupportSQLiteDatabase);
+ method public void onCorruption(androidx.sqlite.db.SupportSQLiteDatabase);
+ method public abstract void onCreate(androidx.sqlite.db.SupportSQLiteDatabase);
+ method public void onDowngrade(androidx.sqlite.db.SupportSQLiteDatabase, int, int);
+ method public void onOpen(androidx.sqlite.db.SupportSQLiteDatabase);
+ method public abstract void onUpgrade(androidx.sqlite.db.SupportSQLiteDatabase, int, int);
field public final int version;
}
public static class SupportSQLiteOpenHelper.Configuration {
- method public static androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder! builder(android.content.Context!);
+ method public static androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder builder(android.content.Context);
field public final androidx.sqlite.db.SupportSQLiteOpenHelper.Callback callback;
field public final android.content.Context context;
field public final String? name;
}
public static class SupportSQLiteOpenHelper.Configuration.Builder {
- method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration! build();
- method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder! callback(androidx.sqlite.db.SupportSQLiteOpenHelper.Callback);
- method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder! name(String?);
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration build();
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder callback(androidx.sqlite.db.SupportSQLiteOpenHelper.Callback);
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder name(String?);
}
public static interface SupportSQLiteOpenHelper.Factory {
- method public androidx.sqlite.db.SupportSQLiteOpenHelper! create(androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration!);
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper create(androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration);
}
public interface SupportSQLiteProgram extends java.io.Closeable {
diff --git a/sqlite/sqlite/api/current.txt b/sqlite/sqlite/api/current.txt
index 99d1651..f4688a2f 100644
--- a/sqlite/sqlite/api/current.txt
+++ b/sqlite/sqlite/api/current.txt
@@ -53,7 +53,7 @@
public interface SupportSQLiteOpenHelper extends java.io.Closeable {
method public void close();
- method public String! getDatabaseName();
+ method public String? getDatabaseName();
method public androidx.sqlite.db.SupportSQLiteDatabase! getReadableDatabase();
method public androidx.sqlite.db.SupportSQLiteDatabase! getWritableDatabase();
method @RequiresApi(api=android.os.Build.VERSION_CODES.JELLY_BEAN) public void setWriteAheadLoggingEnabled(boolean);
@@ -61,30 +61,30 @@
public abstract static class SupportSQLiteOpenHelper.Callback {
ctor public SupportSQLiteOpenHelper.Callback(int);
- method public void onConfigure(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public void onCorruption(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public abstract void onCreate(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public void onDowngrade(androidx.sqlite.db.SupportSQLiteDatabase!, int, int);
- method public void onOpen(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public abstract void onUpgrade(androidx.sqlite.db.SupportSQLiteDatabase!, int, int);
+ method public void onConfigure(androidx.sqlite.db.SupportSQLiteDatabase);
+ method public void onCorruption(androidx.sqlite.db.SupportSQLiteDatabase);
+ method public abstract void onCreate(androidx.sqlite.db.SupportSQLiteDatabase);
+ method public void onDowngrade(androidx.sqlite.db.SupportSQLiteDatabase, int, int);
+ method public void onOpen(androidx.sqlite.db.SupportSQLiteDatabase);
+ method public abstract void onUpgrade(androidx.sqlite.db.SupportSQLiteDatabase, int, int);
field public final int version;
}
public static class SupportSQLiteOpenHelper.Configuration {
- method public static androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder! builder(android.content.Context!);
+ method public static androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder builder(android.content.Context);
field public final androidx.sqlite.db.SupportSQLiteOpenHelper.Callback callback;
field public final android.content.Context context;
field public final String? name;
}
public static class SupportSQLiteOpenHelper.Configuration.Builder {
- method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration! build();
- method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder! callback(androidx.sqlite.db.SupportSQLiteOpenHelper.Callback);
- method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder! name(String?);
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration build();
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder callback(androidx.sqlite.db.SupportSQLiteOpenHelper.Callback);
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder name(String?);
}
public static interface SupportSQLiteOpenHelper.Factory {
- method public androidx.sqlite.db.SupportSQLiteOpenHelper! create(androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration!);
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper create(androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration);
}
public interface SupportSQLiteProgram extends java.io.Closeable {
diff --git a/sqlite/sqlite/api/restricted_2.1.0-alpha01.txt b/sqlite/sqlite/api/restricted_2.1.0-alpha01.txt
index 99d1651..f4688a2f 100644
--- a/sqlite/sqlite/api/restricted_2.1.0-alpha01.txt
+++ b/sqlite/sqlite/api/restricted_2.1.0-alpha01.txt
@@ -53,7 +53,7 @@
public interface SupportSQLiteOpenHelper extends java.io.Closeable {
method public void close();
- method public String! getDatabaseName();
+ method public String? getDatabaseName();
method public androidx.sqlite.db.SupportSQLiteDatabase! getReadableDatabase();
method public androidx.sqlite.db.SupportSQLiteDatabase! getWritableDatabase();
method @RequiresApi(api=android.os.Build.VERSION_CODES.JELLY_BEAN) public void setWriteAheadLoggingEnabled(boolean);
@@ -61,30 +61,30 @@
public abstract static class SupportSQLiteOpenHelper.Callback {
ctor public SupportSQLiteOpenHelper.Callback(int);
- method public void onConfigure(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public void onCorruption(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public abstract void onCreate(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public void onDowngrade(androidx.sqlite.db.SupportSQLiteDatabase!, int, int);
- method public void onOpen(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public abstract void onUpgrade(androidx.sqlite.db.SupportSQLiteDatabase!, int, int);
+ method public void onConfigure(androidx.sqlite.db.SupportSQLiteDatabase);
+ method public void onCorruption(androidx.sqlite.db.SupportSQLiteDatabase);
+ method public abstract void onCreate(androidx.sqlite.db.SupportSQLiteDatabase);
+ method public void onDowngrade(androidx.sqlite.db.SupportSQLiteDatabase, int, int);
+ method public void onOpen(androidx.sqlite.db.SupportSQLiteDatabase);
+ method public abstract void onUpgrade(androidx.sqlite.db.SupportSQLiteDatabase, int, int);
field public final int version;
}
public static class SupportSQLiteOpenHelper.Configuration {
- method public static androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder! builder(android.content.Context!);
+ method public static androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder builder(android.content.Context);
field public final androidx.sqlite.db.SupportSQLiteOpenHelper.Callback callback;
field public final android.content.Context context;
field public final String? name;
}
public static class SupportSQLiteOpenHelper.Configuration.Builder {
- method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration! build();
- method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder! callback(androidx.sqlite.db.SupportSQLiteOpenHelper.Callback);
- method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder! name(String?);
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration build();
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder callback(androidx.sqlite.db.SupportSQLiteOpenHelper.Callback);
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder name(String?);
}
public static interface SupportSQLiteOpenHelper.Factory {
- method public androidx.sqlite.db.SupportSQLiteOpenHelper! create(androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration!);
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper create(androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration);
}
public interface SupportSQLiteProgram extends java.io.Closeable {
diff --git a/sqlite/sqlite/api/restricted_current.txt b/sqlite/sqlite/api/restricted_current.txt
index 99d1651..f4688a2f 100644
--- a/sqlite/sqlite/api/restricted_current.txt
+++ b/sqlite/sqlite/api/restricted_current.txt
@@ -53,7 +53,7 @@
public interface SupportSQLiteOpenHelper extends java.io.Closeable {
method public void close();
- method public String! getDatabaseName();
+ method public String? getDatabaseName();
method public androidx.sqlite.db.SupportSQLiteDatabase! getReadableDatabase();
method public androidx.sqlite.db.SupportSQLiteDatabase! getWritableDatabase();
method @RequiresApi(api=android.os.Build.VERSION_CODES.JELLY_BEAN) public void setWriteAheadLoggingEnabled(boolean);
@@ -61,30 +61,30 @@
public abstract static class SupportSQLiteOpenHelper.Callback {
ctor public SupportSQLiteOpenHelper.Callback(int);
- method public void onConfigure(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public void onCorruption(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public abstract void onCreate(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public void onDowngrade(androidx.sqlite.db.SupportSQLiteDatabase!, int, int);
- method public void onOpen(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public abstract void onUpgrade(androidx.sqlite.db.SupportSQLiteDatabase!, int, int);
+ method public void onConfigure(androidx.sqlite.db.SupportSQLiteDatabase);
+ method public void onCorruption(androidx.sqlite.db.SupportSQLiteDatabase);
+ method public abstract void onCreate(androidx.sqlite.db.SupportSQLiteDatabase);
+ method public void onDowngrade(androidx.sqlite.db.SupportSQLiteDatabase, int, int);
+ method public void onOpen(androidx.sqlite.db.SupportSQLiteDatabase);
+ method public abstract void onUpgrade(androidx.sqlite.db.SupportSQLiteDatabase, int, int);
field public final int version;
}
public static class SupportSQLiteOpenHelper.Configuration {
- method public static androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder! builder(android.content.Context!);
+ method public static androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder builder(android.content.Context);
field public final androidx.sqlite.db.SupportSQLiteOpenHelper.Callback callback;
field public final android.content.Context context;
field public final String? name;
}
public static class SupportSQLiteOpenHelper.Configuration.Builder {
- method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration! build();
- method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder! callback(androidx.sqlite.db.SupportSQLiteOpenHelper.Callback);
- method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder! name(String?);
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration build();
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder callback(androidx.sqlite.db.SupportSQLiteOpenHelper.Callback);
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration.Builder name(String?);
}
public static interface SupportSQLiteOpenHelper.Factory {
- method public androidx.sqlite.db.SupportSQLiteOpenHelper! create(androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration!);
+ method public androidx.sqlite.db.SupportSQLiteOpenHelper create(androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration);
}
public interface SupportSQLiteProgram extends java.io.Closeable {
diff --git a/sqlite/sqlite/lint-baseline.xml b/sqlite/sqlite/lint-baseline.xml
index aba96a0..06b60f6 100644
--- a/sqlite/sqlite/lint-baseline.xml
+++ b/sqlite/sqlite/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="5" by="lint 3.5.0-beta04" client="gradle" variant="debug" version="3.5.0-beta04">
+<issues format="5" by="lint 3.5.0-beta05" client="gradle" variant="all" version="3.5.0-beta05">
<issue
id="UnknownNullness"
@@ -389,22 +389,11 @@
<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
- errorLine1=" String getDatabaseName();"
- errorLine2=" ~~~~~~">
- <location
- file="src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java"
- line="46"
- column="5"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
errorLine1=" SupportSQLiteDatabase getWritableDatabase();"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java"
- line="80"
+ line="82"
column="5"/>
</issue>
@@ -415,156 +404,13 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java"
- line="100"
+ line="102"
column="5"/>
</issue>
<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
- errorLine1=" public void onConfigure(SupportSQLiteDatabase db) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java"
- line="149"
- column="33"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
- errorLine1=" public abstract void onCreate(SupportSQLiteDatabase db);"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java"
- line="159"
- column="39"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
- errorLine1=" public abstract void onUpgrade(SupportSQLiteDatabase db, int oldVersion, int newVersion);"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java"
- line="181"
- column="40"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
- errorLine1=" public void onDowngrade(SupportSQLiteDatabase db, int oldVersion, int newVersion) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java"
- line="200"
- column="33"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
- errorLine1=" public void onOpen(SupportSQLiteDatabase db) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java"
- line="218"
- column="28"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
- errorLine1=" public void onCorruption(SupportSQLiteDatabase db) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java"
- line="229"
- column="34"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
- errorLine1=" public static Builder builder(Context context) {"
- errorLine2=" ~~~~~~~">
- <location
- file="src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java"
- line="330"
- column="23"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
- errorLine1=" public static Builder builder(Context context) {"
- errorLine2=" ~~~~~~~">
- <location
- file="src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java"
- line="330"
- column="39"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
- errorLine1=" public Configuration build() {"
- errorLine2=" ~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java"
- line="342"
- column="20"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
- errorLine1=" public Builder name(@Nullable String name) {"
- errorLine2=" ~~~~~~~">
- <location
- file="src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java"
- line="362"
- column="20"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
- errorLine1=" public Builder callback(@NonNull Callback callback) {"
- errorLine2=" ~~~~~~~">
- <location
- file="src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java"
- line="371"
- column="20"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
- errorLine1=" SupportSQLiteOpenHelper create(Configuration configuration);"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java"
- line="390"
- column="9"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
- errorLine1=" SupportSQLiteOpenHelper create(Configuration configuration);"
- errorLine2=" ~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java"
- line="390"
- column="40"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
errorLine1=" void bindString(int index, String value);"
errorLine2=" ~~~~~~">
<location
diff --git a/sqlite/sqlite/src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java b/sqlite/sqlite/src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java
index 014af07..8c0b7f6 100644
--- a/sqlite/sqlite/src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java
+++ b/sqlite/sqlite/src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java
@@ -42,8 +42,9 @@
public interface SupportSQLiteOpenHelper extends Closeable {
/**
* Return the name of the SQLite database being opened, as given to
- * the constructor.
+ * the constructor. {@code null} indicates an in-memory database.
*/
+ @Nullable
String getDatabaseName();
/**
@@ -147,7 +148,7 @@
*
* @param db The database.
*/
- public void onConfigure(SupportSQLiteDatabase db) {
+ public void onConfigure(@NonNull SupportSQLiteDatabase db) {
}
@@ -157,7 +158,7 @@
*
* @param db The database.
*/
- public abstract void onCreate(SupportSQLiteDatabase db);
+ public abstract void onCreate(@NonNull SupportSQLiteDatabase db);
/**
* Called when the database needs to be upgraded. The implementation
@@ -179,7 +180,8 @@
* @param oldVersion The old database version.
* @param newVersion The new database version.
*/
- public abstract void onUpgrade(SupportSQLiteDatabase db, int oldVersion, int newVersion);
+ public abstract void onUpgrade(@NonNull SupportSQLiteDatabase db, int oldVersion,
+ int newVersion);
/**
* Called when the database needs to be downgraded. This is strictly similar to
@@ -198,7 +200,7 @@
* @param oldVersion The old database version.
* @param newVersion The new database version.
*/
- public void onDowngrade(SupportSQLiteDatabase db, int oldVersion, int newVersion) {
+ public void onDowngrade(@NonNull SupportSQLiteDatabase db, int oldVersion, int newVersion) {
throw new SQLiteException("Can't downgrade database from version "
+ oldVersion + " to " + newVersion);
}
@@ -216,7 +218,7 @@
*
* @param db The database.
*/
- public void onOpen(SupportSQLiteDatabase db) {
+ public void onOpen(@NonNull SupportSQLiteDatabase db) {
}
@@ -227,7 +229,7 @@
* @param db the {@link SupportSQLiteDatabase} object representing the database on which
* corruption is detected.
*/
- public void onCorruption(SupportSQLiteDatabase db) {
+ public void onCorruption(@NonNull SupportSQLiteDatabase db) {
// the following implementation is taken from {@link DefaultDatabaseErrorHandler}.
Log.e(TAG, "Corruption reported by sqlite on database: " + db.getPath());
@@ -299,7 +301,6 @@
/**
* The configuration to create an SQLite open helper object using {@link Factory}.
*/
- @SuppressWarnings("WeakerAccess")
class Configuration {
/**
* Context to use to open or create the database.
@@ -328,7 +329,8 @@
*
* @param context to use to open or create the database.
*/
- public static Builder builder(Context context) {
+ @NonNull
+ public static Builder builder(@NonNull Context context) {
return new Builder(context);
}
@@ -340,6 +342,7 @@
String mName;
SupportSQLiteOpenHelper.Callback mCallback;
+ @NonNull
public Configuration build() {
if (mCallback == null) {
throw new IllegalArgumentException("Must set a callback to create the"
@@ -360,6 +363,7 @@
* @param name Name of the database file, or null for an in-memory database.
* @return This
*/
+ @NonNull
public Builder name(@Nullable String name) {
mName = name;
return this;
@@ -369,6 +373,7 @@
* @param callback The callback class to handle creation, upgrade and downgrade.
* @return this
*/
+ @NonNull
public Builder callback(@NonNull Callback callback) {
mCallback = callback;
return this;
@@ -388,6 +393,7 @@
*
* @return A SupportSQLiteOpenHelper which can be used to open a database.
*/
- SupportSQLiteOpenHelper create(Configuration configuration);
+ @NonNull
+ SupportSQLiteOpenHelper create(@NonNull Configuration configuration);
}
}