From 0b5e1af5fd5118015164be2fffd658d1bbbd8f53 Mon Sep 17 00:00:00 2001 From: joohyukkim Date: Fri, 5 May 2023 13:38:23 +0900 Subject: [PATCH] Modify JavaDoc --- .../databind/introspect/AnnotatedFieldCollector.java | 1 + .../jackson/databind/ser/BasicSerializerFactory.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedFieldCollector.java b/src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedFieldCollector.java index 0a004f93bf..f56081c35c 100644 --- a/src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedFieldCollector.java +++ b/src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedFieldCollector.java @@ -124,6 +124,7 @@ private void _addFieldMixIns(Class mixInCls, Class targetClass, private boolean _isIncludableField(Field f) { + // [databind#2787]: Allow `Enum` mixins if (f.isEnumConstant()) { return true; } diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/BasicSerializerFactory.java b/src/main/java/com/fasterxml/jackson/databind/ser/BasicSerializerFactory.java index 574038e728..16d57f3794 100644 --- a/src/main/java/com/fasterxml/jackson/databind/ser/BasicSerializerFactory.java +++ b/src/main/java/com/fasterxml/jackson/databind/ser/BasicSerializerFactory.java @@ -1231,13 +1231,13 @@ protected JsonSerializer buildEnumSerializer(SerializationConfig config, /** * Helper method used in the serialization of an {@link Enum} to remove any self-referencing properties from * the bean description before it is transformed into a JSON Object as configured by {@link JsonFormat.Shape#OBJECT}. - * - * Specifically, this method iterates through the properties of the bean description and removes any that are + *

+ * Basically, this method iterates through the properties of the bean description and removes any that are * an enum type and a subtype of the enum class to be serialized. * * @param beanDesc the bean description to remove Enum properties from. * - * @since 2.16 + * @since 2.16 : [databind#2787]: remove self-referencing enum fields introduced by annotation flattening of mixins */ private void _removeEnumSelfReferences(BasicBeanDescription beanDesc) { Class aClass = ClassUtil.findEnumType(beanDesc.getBeanClass());