Do not write hasAnnotations flag for properties with source-only annotations
This does not break or fix any behavior except the fact that deserialization will now not try loading annotations on a property which had no binary- or runtime-retained annotations in the sources
This commit is contained in:
+3
-5
@@ -164,9 +164,7 @@ class DescriptorSerializer private constructor(
|
|||||||
val hasConstant = compileTimeConstant != null && compileTimeConstant !is NullValue
|
val hasConstant = compileTimeConstant != null && compileTimeConstant !is NullValue
|
||||||
|
|
||||||
val hasAnnotations =
|
val hasAnnotations =
|
||||||
!descriptor.annotations.isEmpty() ||
|
hasAnnotations(descriptor) || hasAnnotations(descriptor.backingField) || hasAnnotations(descriptor.delegateField)
|
||||||
descriptor.backingField?.annotations?.isEmpty() == false ||
|
|
||||||
descriptor.delegateField?.annotations?.isEmpty() == false
|
|
||||||
|
|
||||||
val propertyFlags = Flags.getAccessorFlags(
|
val propertyFlags = Flags.getAccessorFlags(
|
||||||
hasAnnotations,
|
hasAnnotations,
|
||||||
@@ -751,8 +749,8 @@ class DescriptorSerializer private constructor(
|
|||||||
Variance.OUT_VARIANCE -> ProtoBuf.Type.Argument.Projection.OUT
|
Variance.OUT_VARIANCE -> ProtoBuf.Type.Argument.Projection.OUT
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hasAnnotations(descriptor: Annotated): Boolean =
|
private fun hasAnnotations(descriptor: Annotated?): Boolean =
|
||||||
descriptor.nonSourceAnnotations.isNotEmpty()
|
descriptor != null && descriptor.nonSourceAnnotations.isNotEmpty()
|
||||||
|
|
||||||
fun <T : DeclarationDescriptor> sort(descriptors: Collection<T>): List<T> =
|
fun <T : DeclarationDescriptor> sort(descriptors: Collection<T>): List<T> =
|
||||||
ArrayList(descriptors).apply {
|
ArrayList(descriptors).apply {
|
||||||
|
|||||||
Reference in New Issue
Block a user