From 7b4ff5ea7435db40f5b84b2333fee0d6ae609df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Mon, 10 Oct 2022 18:17:27 +0200 Subject: [PATCH] Make BindingReflectionHintsRegistrar protected methods private In order to keep the maximum of flexibility, this commit makes shouldSkipType and shouldSkipMembers methods private. That will allow for example to refactor BindingReflectionHintsRegistrar in order to support skipping custom classes specified via @RegisterReflectionForBinding without having to subclass it. See gh-29279 --- .../aot/hint/BindingReflectionHintsRegistrar.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/aot/hint/BindingReflectionHintsRegistrar.java b/spring-core/src/main/java/org/springframework/aot/hint/BindingReflectionHintsRegistrar.java index 5fb6078b09..134711407d 100644 --- a/spring-core/src/main/java/org/springframework/aot/hint/BindingReflectionHintsRegistrar.java +++ b/spring-core/src/main/java/org/springframework/aot/hint/BindingReflectionHintsRegistrar.java @@ -63,21 +63,11 @@ public class BindingReflectionHintsRegistrar { } } - /** - * Return whether the type should be skipped. - * @param type the type to evaluate - * @return {@code true} if the type should be skipped - */ - protected boolean shouldSkipType(Class type) { + private boolean shouldSkipType(Class type) { return type.isPrimitive() || type == Object.class; } - /** - * Return whether the members of the type should be skipped. - * @param type the type to evaluate - * @return {@code true} if the members of the type should be skipped - */ - protected boolean shouldSkipMembers(Class type) { + private boolean shouldSkipMembers(Class type) { return type.getCanonicalName().startsWith("java.") || type.isArray(); }