commit | 53733ba36a888201aa60eeb9c3ae3b15f3b05e10 | [log] [tgz] |
---|---|---|
author | Brad Corso <bcorso@google.com> | Tue Feb 15 20:06:43 2022 -0800 |
committer | Brad Corso <bcorso@google.com> | Tue Feb 15 20:31:36 2022 -0800 |
tree | 903d8bd5894f8f4cd61f0e6d76ed3ba26afec2a3 | |
parent | 7e7414d150fb06a9a12941c53fc53a0ed05ba1de [diff] |
Add back methods replaced by enclosingElement This CL adds back XEnumEntry#enumTypeElement() and XExecutableParameterElement#enclosingMethodElement() that were replaced by XElement#enclosingElement() in https://android-review.googlesource.com/c/platform/frameworks/support/+/1948583 This should make it easier to migrate to the new API without breaking existing code. Bug: 219851636 Test: ./gradlew :room:r-c-p:test Change-Id: I98bb3b234a59b703295be172c8264caf3d3c85c0
diff --git a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XEnumEntry.kt b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XEnumEntry.kt index c271190..c0d53adf 100644 --- a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XEnumEntry.kt +++ b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XEnumEntry.kt
@@ -31,6 +31,15 @@ * The parent enum type declaration that holds all entries for this enum type.. */ override val enclosingElement: XEnumTypeElement + + /** + * The parent enum type declaration that holds all entries for this enum type.. + */ + @Deprecated(message = "use XEnumEntry#enclosingElement() instead.", + replaceWith = ReplaceWith("enclosingElement") + ) + val enumTypeElement: XEnumTypeElement + get() = enclosingElement } fun XElement.isEnumEntry(): Boolean {
diff --git a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XExecutableParameterElement.kt b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XExecutableParameterElement.kt index b4b85df..b5148d4 100644 --- a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XExecutableParameterElement.kt +++ b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XExecutableParameterElement.kt
@@ -27,6 +27,15 @@ override val enclosingElement: XExecutableElement /** + * The enclosing [XExecutableElement] this parameter belongs to. + */ + @Deprecated(message = "use XExecutableParameterElement#enclosingElement() instead.", + replaceWith = ReplaceWith("enclosingElement") + ) + val enclosingMethodElement: XExecutableElement + get() = enclosingElement + + /** * `true` if the parameter has a default value, `false` otherwise. * * Note that when @JvmOverloads is used in a kotlin function with KAPT, only the original