Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Aug 13, 2024
1 parent 8be5010 commit d0bff58
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ public class BindingReflectionHintsRegistrar {

private static final String JACKSON_ANNOTATION = "com.fasterxml.jackson.annotation.JacksonAnnotation";

private static final boolean jacksonAnnotationPresent = ClassUtils.isPresent(JACKSON_ANNOTATION,
BindingReflectionHintsRegistrar.class.getClassLoader());
private static final boolean jacksonAnnotationPresent =
ClassUtils.isPresent(JACKSON_ANNOTATION, BindingReflectionHintsRegistrar.class.getClassLoader());


/**
* Register the necessary reflection hints to bind the specified types.
Expand Down Expand Up @@ -95,12 +96,10 @@ private void registerReflectionHints(ReflectionHints hints, Set<Type> seen, Type
}
}
if (clazz.isEnum()) {
typeHint.withMembers(
MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS,
typeHint.withMembers(MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS,
MemberCategory.INVOKE_PUBLIC_METHODS);
}
typeHint.withMembers(
MemberCategory.DECLARED_FIELDS,
typeHint.withMembers(MemberCategory.DECLARED_FIELDS,
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);
for (Method method : clazz.getMethods()) {
String methodName = method.getName();
Expand Down Expand Up @@ -137,8 +136,7 @@ private void registerRecordHints(ReflectionHints hints, Set<Type> seen, Method m
}

private void registerPropertyHints(ReflectionHints hints, Set<Type> seen, @Nullable Method method, int parameterIndex) {
if (method != null && method.getDeclaringClass() != Object.class &&
method.getDeclaringClass() != Enum.class) {
if (method != null && method.getDeclaringClass() != Object.class && method.getDeclaringClass() != Enum.class) {
hints.registerMethod(method, ExecutableMode.INVOKE);
MethodParameter methodParameter = MethodParameter.forExecutable(method, parameterIndex);
Type methodParameterType = methodParameter.getGenericParameterType();
Expand Down Expand Up @@ -213,6 +211,7 @@ private void registerHintsForClassAttributes(ReflectionHints hints, MergedAnnota
});
}


/**
* Inner class to avoid a hard dependency on Kotlin at runtime.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -393,7 +393,7 @@ private String toHeaderValue() {
}

private void appendDirective(StringBuilder builder, String value) {
if (builder.length() > 0) {
if (!builder.isEmpty()) {
builder.append(", ");
}
builder.append(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,7 @@ public void registerDeferredResultInterceptors(DeferredResultProcessingIntercept
}

/**
* Mark the {@link WebAsyncManager} as wrapping a
* multipart async request.
* Mark the {@link WebAsyncManager} as wrapping a multipart async request.
* @since 6.1.12
*/
public void setMultipartRequestParsed(boolean isMultipart) {
Expand Down

0 comments on commit d0bff58

Please sign in to comment.