@@ -651,20 +651,19 @@ public TypeResolverBuilder<?> findPropertyContentTypeResolver(MapperConfig<?> co
651
651
public List <NamedType > findSubtypes (MapperConfig <?> config , Annotated a )
652
652
{
653
653
JsonSubTypes t = _findAnnotation (a , JsonSubTypes .class );
654
- if (t != null ) {
654
+ if (t != null ) {
655
655
return findSubtypesByJsonSubTypesAnnotation (config , a , t );
656
656
}
657
-
658
- if (a .getAnnotated () instanceof Class <?> clazz && clazz .isSealed ()
657
+ if (a .getAnnotated () instanceof Class <?> clazz && clazz .isSealed ()
659
658
&& clazz .getPermittedSubclasses ().length > 0 ) {
660
659
return findSubtypesByPermittedSubclasses (config , a , clazz );
661
660
}
662
-
663
661
return null ;
664
662
}
665
663
666
664
// @since 3.0
667
- private List <NamedType > findSubtypesByJsonSubTypesAnnotation (MapperConfig <?> config , Annotated a , JsonSubTypes t )
665
+ private List <NamedType > findSubtypesByJsonSubTypesAnnotation (MapperConfig <?> config ,
666
+ Annotated a , JsonSubTypes t )
668
667
{
669
668
JsonSubTypes .Type [] types = t .value ();
670
669
@@ -673,7 +672,7 @@ private List<NamedType> findSubtypesByJsonSubTypesAnnotation(MapperConfig<?> con
673
672
if (t .failOnRepeatedNames ()) {
674
673
return findSubtypesByJsonSubTypesAnnotationCheckRepeatedNames (a .getName (), types );
675
674
} else {
676
- ArrayList <NamedType > result = new ArrayList <NamedType >(types .length );
675
+ ArrayList <NamedType > result = new ArrayList <>(types .length );
677
676
for (JsonSubTypes .Type type : types ) {
678
677
result .add (new NamedType (type .value (), type .name ()));
679
678
// [databind#2761]: alternative set of names to use
@@ -686,9 +685,10 @@ private List<NamedType> findSubtypesByJsonSubTypesAnnotation(MapperConfig<?> con
686
685
}
687
686
688
687
// @since 3.0
689
- private List <NamedType > findSubtypesByJsonSubTypesAnnotationCheckRepeatedNames (String annotatedTypeName , JsonSubTypes .Type [] types )
688
+ private List <NamedType > findSubtypesByJsonSubTypesAnnotationCheckRepeatedNames (String annotatedTypeName ,
689
+ JsonSubTypes .Type [] types )
690
690
{
691
- ArrayList <NamedType > result = new ArrayList <NamedType >(types .length );
691
+ ArrayList <NamedType > result = new ArrayList <>(types .length );
692
692
Set <String > seenNames = new HashSet <>();
693
693
for (JsonSubTypes .Type type : types ) {
694
694
final String typeName = type .name ();
0 commit comments