Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
https://android-review.googlesource.com/1123258
https://goto.google.com/android-sha1/b90079595f33f58fece04026a97faa0d243acdb1
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
ap...@google.com <ap...@google.com> #3
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically ( b/140759491 ).
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
https://android-review.googlesource.com/1288456
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit dd1f1d0c043d8986a98cc7fd08f3e997d0fc264a
Author: Yigit Boyar <yboyar@google.com>
Date: Fri Nov 12 23:19:09 2021
Rename XMethodElement.name to jvmName
This is in preparation for separating method names from their jvm names.
This CL is a no-op simple rename. The followup will introduce name back
which will refer to the name in source code. Moreover, that CL will also
change Room to use name whenever appropriate. For instance, when
matching fields to their setters/getters, we actually want the name, not
jvm name because jvm name of methods might differenciate based on the
visibility of the method.
Separating name vs jvmName has two benefits:
a) Performance. Resolving jvm name is expensive in KSP because it
requires resolving types (to see if they are inline). Note that gaining
this performance for classpath inputs will require changing XProcessing
to not always return fields / methods in their declaration order (make
it an additional API instead).
b) Logically, we always want the name except for java code generation.
Bug: 205289020
Test: existing tests
Change-Id: I7fd61193db833922ee3b7af64f6cf20eb3d244c0
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/ksp/KspTypeNamesGoldenTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/DeletionMethodProcessor.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/DaoProcessorTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/FallbackLocationInformationTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XAnnotationBoxTest.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/synthetic/KspSyntheticPropertyMethodElement.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/RawQueryMethodProcessor.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/InsertionMethodProcessorTest.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/ResolverExt.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/FieldSetter.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XRoundEnvTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/ext/ElementExtTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/DeletionMethod.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/UpdateMethodProcessor.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/TableEntityProcessorTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/InsertionMethod.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/DaoProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/PojoMethodProcessor.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XNullabilityTest.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspClassFileUtility.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/FieldGetter.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/DatabaseProcessorTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/CustomTypeConverter.kt
M room/room-compiler/src/main/kotlin/androidx/room/ext/xtype_ext.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/ShortcutMethod.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/PojoMethod.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XProcessingStepTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/QueryMethod.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/InternalModifierTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/ksp/KspTypeTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/MethodProcessorDelegate.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacMethodElement.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/DatabaseProcessor.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XTypeTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/FieldReadWriteWriter.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XMethodElement.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/JavaPoetExt.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/ksp/KSAsMemberOfTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XExecutableElementTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/TransactionMethodProcessorTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/InsertionMethodProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/Constructor.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/MethodSpecHelperTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XElementTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XAnnotationTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/DaoMethod.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/PojoProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/UpdateMethod.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/DeclarationCollector.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/TypeAliasTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/KotlinMetadataTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/util/TestExtensions.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XExecutableTypeTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/compat/XConvertersTest.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspMethodElement.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/ShortcutMethodProcessorTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/ShortcutParameterProcessor.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XTypeElementTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/KspClassFileUtilityTest.kt
https://android-review.googlesource.com/1891247
Branch: androidx-main
commit dd1f1d0c043d8986a98cc7fd08f3e997d0fc264a
Author: Yigit Boyar <yboyar@google.com>
Date: Fri Nov 12 23:19:09 2021
Rename XMethodElement.name to jvmName
This is in preparation for separating method names from their jvm names.
This CL is a no-op simple rename. The followup will introduce name back
which will refer to the name in source code. Moreover, that CL will also
change Room to use name whenever appropriate. For instance, when
matching fields to their setters/getters, we actually want the name, not
jvm name because jvm name of methods might differenciate based on the
visibility of the method.
Separating name vs jvmName has two benefits:
a) Performance. Resolving jvm name is expensive in KSP because it
requires resolving types (to see if they are inline). Note that gaining
this performance for classpath inputs will require changing XProcessing
to not always return fields / methods in their declaration order (make
it an additional API instead).
b) Logically, we always want the name except for java code generation.
Bug: 205289020
Test: existing tests
Change-Id: I7fd61193db833922ee3b7af64f6cf20eb3d244c0
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/ksp/KspTypeNamesGoldenTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/DeletionMethodProcessor.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/DaoProcessorTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/FallbackLocationInformationTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XAnnotationBoxTest.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/synthetic/KspSyntheticPropertyMethodElement.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/RawQueryMethodProcessor.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/InsertionMethodProcessorTest.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/ResolverExt.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/FieldSetter.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XRoundEnvTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/ext/ElementExtTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/DeletionMethod.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/UpdateMethodProcessor.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/TableEntityProcessorTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/InsertionMethod.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/DaoProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/PojoMethodProcessor.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XNullabilityTest.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspClassFileUtility.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/FieldGetter.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/DatabaseProcessorTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/CustomTypeConverter.kt
M room/room-compiler/src/main/kotlin/androidx/room/ext/xtype_ext.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/ShortcutMethod.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/PojoMethod.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XProcessingStepTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/QueryMethod.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/InternalModifierTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/ksp/KspTypeTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/MethodProcessorDelegate.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacMethodElement.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/DatabaseProcessor.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XTypeTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/FieldReadWriteWriter.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XMethodElement.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/JavaPoetExt.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/ksp/KSAsMemberOfTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XExecutableElementTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/TransactionMethodProcessorTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/InsertionMethodProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/Constructor.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/MethodSpecHelperTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XElementTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XAnnotationTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/DaoMethod.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/PojoProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/UpdateMethod.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/DeclarationCollector.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/TypeAliasTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/KotlinMetadataTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/util/TestExtensions.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XExecutableTypeTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/compat/XConvertersTest.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspMethodElement.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/ShortcutMethodProcessorTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/ShortcutParameterProcessor.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XTypeElementTest.kt
M room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/KspClassFileUtilityTest.kt
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit 7ce58f6d42595983aab61f37ac70032e9171e238
Author: Yigit Boyar <yboyar@google.com>
Date: Mon Nov 15 21:15:55 2021
Support internal properties in Room
This CL fixes a bug in POJO processor where while matching fields to
methods, it was using the jvm name of the method rather than the source
name.
As the JVM name for internal properties get a $pkg suffix, they were not
matching the property
Fixes: 205289020
Test: InternalsTest
RelNote: "Added support for internal properties in Kotlin sources.
This is a slight behavior change in Room where it will use the source
name of functions while matching them to properties as getters/setters
(previously, it was using JVM name of the function which is different
for internal functions/properties).
If you are using custom `@JvmName` annotations to match getters/setters
to private properties, please double check the generated code after the
update"
Change-Id: If653164362c49fd00650d9a953f330afdb309c1c
M room/room-compiler/src/main/kotlin/androidx/room/processor/PojoProcessor.kt
A room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/InternalsTest.kt
https://android-review.googlesource.com/1893381
Branch: androidx-main
commit 7ce58f6d42595983aab61f37ac70032e9171e238
Author: Yigit Boyar <yboyar@google.com>
Date: Mon Nov 15 21:15:55 2021
Support internal properties in Room
This CL fixes a bug in POJO processor where while matching fields to
methods, it was using the jvm name of the method rather than the source
name.
As the JVM name for internal properties get a $pkg suffix, they were not
matching the property
Fixes: 205289020
Test: InternalsTest
RelNote: "Added support for internal properties in Kotlin sources.
This is a slight behavior change in Room where it will use the source
name of functions while matching them to properties as getters/setters
(previously, it was using JVM name of the function which is different
for internal functions/properties).
If you are using custom `@JvmName` annotations to match getters/setters
to private properties, please double check the generated code after the
update"
Change-Id: If653164362c49fd00650d9a953f330afdb309c1c
M room/room-compiler/src/main/kotlin/androidx/room/processor/PojoProcessor.kt
A room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/InternalsTest.kt
Description
see this test:https://android-review.googlesource.com/c/platform/frameworks/support/+/1881029/3/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/InternalsTest.kt#48
This does not even compile as it seems like we don't properly rename getters/setters for properties such that we cannot find the getter/setter for internal properties.