11/*
2- * Copyright 2002-2023 the original author or authors.
2+ * Copyright 2002-2024 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
4040
4141/**
4242 * Register the necessary reflection hints so that the specified type can be
43- * bound at runtime. Fields, constructors, properties and record components
43+ * bound at runtime. Fields, constructors, properties, and record components
4444 * are registered, except for a set of types like those in the {@code java.}
4545 * package where just the type is registered. Types are discovered transitively
4646 * on properties and record components, and generic types are registered as well.
@@ -54,8 +54,9 @@ public class BindingReflectionHintsRegistrar {
5454
5555 private static final String JACKSON_ANNOTATION = "com.fasterxml.jackson.annotation.JacksonAnnotation" ;
5656
57- private static final boolean jacksonAnnotationPresent = ClassUtils .isPresent (JACKSON_ANNOTATION ,
58- BindingReflectionHintsRegistrar .class .getClassLoader ());
57+ private static final boolean jacksonAnnotationPresent =
58+ ClassUtils .isPresent (JACKSON_ANNOTATION , BindingReflectionHintsRegistrar .class .getClassLoader ());
59+
5960
6061 /**
6162 * Register the necessary reflection hints to bind the specified types.
@@ -94,8 +95,7 @@ private void registerReflectionHints(ReflectionHints hints, Set<Type> seen, Type
9495 registerRecordHints (hints , seen , recordComponent .getAccessor ());
9596 }
9697 }
97- typeHint .withMembers (
98- MemberCategory .DECLARED_FIELDS ,
98+ typeHint .withMembers (MemberCategory .DECLARED_FIELDS ,
9999 MemberCategory .INVOKE_DECLARED_CONSTRUCTORS );
100100 for (Method method : clazz .getMethods ()) {
101101 String methodName = method .getName ();
@@ -132,8 +132,7 @@ private void registerRecordHints(ReflectionHints hints, Set<Type> seen, Method m
132132 }
133133
134134 private void registerPropertyHints (ReflectionHints hints , Set <Type > seen , @ Nullable Method method , int parameterIndex ) {
135- if (method != null && method .getDeclaringClass () != Object .class &&
136- method .getDeclaringClass () != Enum .class ) {
135+ if (method != null && method .getDeclaringClass () != Object .class && method .getDeclaringClass () != Enum .class ) {
137136 hints .registerMethod (method , ExecutableMode .INVOKE );
138137 MethodParameter methodParameter = MethodParameter .forExecutable (method , parameterIndex );
139138 Type methodParameterType = methodParameter .getGenericParameterType ();
@@ -191,13 +190,13 @@ private void forEachJacksonAnnotation(AnnotatedElement element, Consumer<MergedA
191190 .from (element , MergedAnnotations .SearchStrategy .TYPE_HIERARCHY )
192191 .stream (JACKSON_ANNOTATION )
193192 .filter (MergedAnnotation ::isMetaPresent )
194- .forEach (action :: accept );
193+ .forEach (action );
195194 }
196195
197196 private void registerHintsForClassAttributes (ReflectionHints hints , MergedAnnotation <Annotation > annotation ) {
198- annotation .getRoot ().asMap ().forEach ((key , value ) -> {
197+ annotation .getRoot ().asMap ().forEach ((attributeName , value ) -> {
199198 if (value instanceof Class <?> classValue && value != Void .class ) {
200- if (key .equals ("builder" )) {
199+ if (attributeName .equals ("builder" )) {
201200 hints .registerType (classValue , MemberCategory .INVOKE_DECLARED_CONSTRUCTORS ,
202201 MemberCategory .INVOKE_DECLARED_METHODS );
203202 }
@@ -208,6 +207,7 @@ private void registerHintsForClassAttributes(ReflectionHints hints, MergedAnnota
208207 });
209208 }
210209
210+
211211 /**
212212 * Inner class to avoid a hard dependency on Kotlin at runtime.
213213 */
0 commit comments