Skip to content

Commit

Permalink
Make BindingReflectionHintsRegistrar protected methods private
Browse files Browse the repository at this point in the history
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 spring-projectsgh-29279
  • Loading branch information
sdeleuze committed Oct 10, 2022
1 parent 4eca87b commit 7b4ff5e
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,11 @@ public void registerReflectionHints(ReflectionHints hints, Type... types) {
}
}

/**
* 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();
}

Expand Down

0 comments on commit 7b4ff5e

Please sign in to comment.