JVM: don't skip nullability annotations on private fields
Unfortunately, some annotation processors rely on those annotations.
This commit is contained in:
@@ -435,10 +435,10 @@ public class PropertyCodegen {
|
|||||||
|
|
||||||
if (annotatedField != null) {
|
if (annotatedField != null) {
|
||||||
// Don't emit nullability annotations for backing field if:
|
// Don't emit nullability annotations for backing field if:
|
||||||
// - backing field is invisible from Java (private or synthetic);
|
// - backing field is synthetic;
|
||||||
// - property is lateinit (since corresponding field is actually nullable).
|
// - property is lateinit (since corresponding field is actually nullable).
|
||||||
boolean skipNullabilityAnnotations =
|
boolean skipNullabilityAnnotations =
|
||||||
(modifiers & ACC_PRIVATE) != 0 || (modifiers & ACC_SYNTHETIC) != 0 ||
|
(modifiers & ACC_SYNTHETIC) != 0 ||
|
||||||
propertyDescriptor.isLateInit();
|
propertyDescriptor.isLateInit();
|
||||||
AnnotationCodegen.forField(fv, memberCodegen, state, skipNullabilityAnnotations)
|
AnnotationCodegen.forField(fv, memberCodegen, state, skipNullabilityAnnotations)
|
||||||
.genAnnotations(annotatedField, type, propertyDescriptor.getType());
|
.genAnnotations(annotatedField, type, propertyDescriptor.getType());
|
||||||
|
|||||||
Reference in New Issue
Block a user