Skip to content

Commit 426fef5

Browse files
committed
Improve JavaDoc wrt FasterXML#2787
1 parent 1f5baf6 commit 426fef5

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/main/java/com/fasterxml/jackson/databind/ser/BasicSerializerFactory.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,23 +1229,23 @@ protected JsonSerializer<?> buildEnumSerializer(SerializationConfig config,
12291229
}
12301230

12311231
/**
1232-
* Helper method used in the serialization of an {@link Enum} to remove any self-referencing properties from
1233-
* the bean description before it is transformed into a JSON Object as configured by {@link JsonFormat.Shape#OBJECT}.
1232+
* Helper method used for serialization {@link Enum} as {@link JsonFormat.Shape#OBJECT}. Removes any
1233+
* self-referencing properties from its bean description before it is transformed into a JSON Object
1234+
* as configured by {@link JsonFormat.Shape#OBJECT}.
12341235
* <p>
1235-
* Basically, this method iterates through the properties of the bean description and removes any that are
1236-
* an enum type and a subtype of the enum class to be serialized.
1236+
* Internally, this method iterates through {@link BeanDescription#findProperties()} and removes self.
12371237
*
12381238
* @param beanDesc the bean description to remove Enum properties from.
12391239
*
1240-
* @since 2.16 : [databind#2787]: remove self-referencing enum fields introduced by annotation flattening of mixins
1240+
* @since 2.16
12411241
*/
12421242
private void _removeEnumSelfReferences(BasicBeanDescription beanDesc) {
12431243
Class<?> aClass = ClassUtil.findEnumType(beanDesc.getBeanClass());
12441244
Iterator<BeanPropertyDefinition> it = beanDesc.findProperties().iterator();
12451245
while (it.hasNext()) {
12461246
BeanPropertyDefinition property = it.next();
1247-
// Remove enums, because they are self-referenced
12481247
JavaType propType = property.getPrimaryType();
1248+
// is the property a self-reference?
12491249
if (propType.isEnumType() && propType.isTypeOrSubTypeOf(aClass)) {
12501250
it.remove();
12511251
}

src/main/java/com/fasterxml/jackson/databind/util/EnumResolver.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ protected EnumResolver(Class<Enum<?>> enumClass, Enum<?>[] enums,
7777
* Enum value.
7878
*
7979
* @since 2.12
80-
* @deprecated Since 2.16 use {@link #constructFor(DeserializationConfig, Class)} instead
80+
* @deprecated Since 2.16 use {@link #constructFor(DeserializationConfig, AnnotatedClass)} instead
8181
*/
8282
public static EnumResolver constructFor(DeserializationConfig config,
8383
Class<?> enumCls) {
@@ -86,6 +86,7 @@ public static EnumResolver constructFor(DeserializationConfig config,
8686

8787
/**
8888
* @since 2.15
89+
* @deprecated Since 2.16 use {@link #_constructFor(DeserializationConfig, AnnotatedClass)} instead
8990
*/
9091
protected static EnumResolver _constructFor(DeserializationConfig config, Class<?> enumCls0)
9192
{

0 commit comments

Comments
 (0)