Add missing type arg extend to adapter methods.
Bug: 137221160
Test: KotlinTestApp compiles with newly added DAO methods.
Change-Id: I2e904c1b923bd58b057678756cc72bda845a4823
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BaseDao.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BaseDao.kt
index 5224667..1653a0e 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BaseDao.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BaseDao.kt
@@ -30,6 +30,12 @@
fun insertAll(t: List<T>)
@Insert
+ fun insertAllSet(t: Set<T>): List<Long>
+
+ @Insert
+ fun insertAllCollection(t: Collection<T>): Array<Long>
+
+ @Insert
fun insertAllArg(vararg t: T)
@Update
diff --git a/room/runtime/api/restricted_2.2.0-alpha02.txt b/room/runtime/api/restricted_2.2.0-alpha02.txt
index fbffaa6..075d847 100644
--- a/room/runtime/api/restricted_2.2.0-alpha02.txt
+++ b/room/runtime/api/restricted_2.2.0-alpha02.txt
@@ -22,12 +22,12 @@
method public final void insert(T![]!);
method public final void insert(Iterable<? extends T>!);
method public final long insertAndReturnId(T!);
- method public final long[]! insertAndReturnIdsArray(java.util.Collection<T!>!);
+ method public final long[]! insertAndReturnIdsArray(java.util.Collection<? extends T>!);
method public final long[]! insertAndReturnIdsArray(T![]!);
- method public final Long![]! insertAndReturnIdsArrayBox(java.util.Collection<T!>!);
+ method public final Long![]! insertAndReturnIdsArrayBox(java.util.Collection<? extends T>!);
method public final Long![]! insertAndReturnIdsArrayBox(T![]!);
method public final java.util.List<java.lang.Long!>! insertAndReturnIdsList(T![]!);
- method public final java.util.List<java.lang.Long!>! insertAndReturnIdsList(java.util.Collection<T!>!);
+ method public final java.util.List<java.lang.Long!>! insertAndReturnIdsList(java.util.Collection<? extends T>!);
}
public class InvalidationTracker {
diff --git a/room/runtime/api/restricted_current.txt b/room/runtime/api/restricted_current.txt
index fbffaa6..075d847 100644
--- a/room/runtime/api/restricted_current.txt
+++ b/room/runtime/api/restricted_current.txt
@@ -22,12 +22,12 @@
method public final void insert(T![]!);
method public final void insert(Iterable<? extends T>!);
method public final long insertAndReturnId(T!);
- method public final long[]! insertAndReturnIdsArray(java.util.Collection<T!>!);
+ method public final long[]! insertAndReturnIdsArray(java.util.Collection<? extends T>!);
method public final long[]! insertAndReturnIdsArray(T![]!);
- method public final Long![]! insertAndReturnIdsArrayBox(java.util.Collection<T!>!);
+ method public final Long![]! insertAndReturnIdsArrayBox(java.util.Collection<? extends T>!);
method public final Long![]! insertAndReturnIdsArrayBox(T![]!);
method public final java.util.List<java.lang.Long!>! insertAndReturnIdsList(T![]!);
- method public final java.util.List<java.lang.Long!>! insertAndReturnIdsList(java.util.Collection<T!>!);
+ method public final java.util.List<java.lang.Long!>! insertAndReturnIdsList(java.util.Collection<? extends T>!);
}
public class InvalidationTracker {
diff --git a/room/runtime/src/main/java/androidx/room/EntityInsertionAdapter.java b/room/runtime/src/main/java/androidx/room/EntityInsertionAdapter.java
index 8572f9e..3046d6c 100644
--- a/room/runtime/src/main/java/androidx/room/EntityInsertionAdapter.java
+++ b/room/runtime/src/main/java/androidx/room/EntityInsertionAdapter.java
@@ -123,7 +123,7 @@
* @param entities Entities to insert
* @return The SQLite row ids, for entities that are not inserted the row id returned will be -1
*/
- public final long[] insertAndReturnIdsArray(Collection<T> entities) {
+ public final long[] insertAndReturnIdsArray(Collection<? extends T> entities) {
final SupportSQLiteStatement stmt = acquire();
try {
final long[] result = new long[entities.size()];
@@ -167,7 +167,7 @@
* @param entities Entities to insert
* @return The SQLite row ids, for entities that are not inserted the row id returned will be -1
*/
- public final Long[] insertAndReturnIdsArrayBox(Collection<T> entities) {
+ public final Long[] insertAndReturnIdsArrayBox(Collection<? extends T> entities) {
final SupportSQLiteStatement stmt = acquire();
try {
final Long[] result = new Long[entities.size()];
@@ -233,7 +233,7 @@
* @param entities Entities to insert
* @return The SQLite row ids, for entities that are not inserted the row id returned will be -1
*/
- public final List<Long> insertAndReturnIdsList(Collection<T> entities) {
+ public final List<Long> insertAndReturnIdsList(Collection<? extends T> entities) {
final SupportSQLiteStatement stmt = acquire();
try {
final List<Long> result = new ArrayList<>(entities.size());