Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.springframework.aot.hint.ResourceHints;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.aot.hint.TypeHint;
import org.springframework.aot.hint.TypeReference;

/**
Expand Down Expand Up @@ -61,11 +62,9 @@ private void registerProxies(ProxyHints proxy, String... classNames) {
}

private void registerForMostReflection(ReflectionHints reflection, String... classNames) {
reflection.registerTypes(typeReferences(classNames), hint -> {
hint.withMembers(MemberCategory.DECLARED_CLASSES, MemberCategory.DECLARED_FIELDS,
MemberCategory.PUBLIC_CLASSES, MemberCategory.PUBLIC_FIELDS,
MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS, MemberCategory.INVOKE_PUBLIC_METHODS);
});
reflection.registerTypes(typeReferences(classNames),
TypeHint.builtWith(MemberCategory.ACCESS_DECLARED_FIELDS, MemberCategory.ACCESS_PUBLIC_FIELDS,
MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS, MemberCategory.INVOKE_PUBLIC_METHODS));
}

private List<TypeReference> typeReferences(String... classNames) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ void test() {
TypeHint typeHint = hints.getTypeHint(typeReference);
assertThat(typeHint).withFailMessage(() -> "No hints found for typeReference " + typeReference).isNotNull();
Set<MemberCategory> memberCategories = typeHint.getMemberCategories();
assertThat(memberCategories).containsExactlyInAnyOrder(MemberCategory.DECLARED_CLASSES,
MemberCategory.DECLARED_FIELDS, MemberCategory.PUBLIC_CLASSES, MemberCategory.PUBLIC_FIELDS,
MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS, MemberCategory.INVOKE_PUBLIC_METHODS);
assertThat(memberCategories).containsExactlyInAnyOrder(MemberCategory.ACCESS_DECLARED_FIELDS,
MemberCategory.ACCESS_PUBLIC_FIELDS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS,
MemberCategory.INVOKE_PUBLIC_METHODS);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ private List<TypeReference> typeReferences(String... classNames) {
}

private void registerForMostReflection(ReflectionHints reflection, String... classNames) {
reflection.registerTypes(typeReferences(classNames), hint -> {
hint.withMembers(MemberCategory.DECLARED_CLASSES, MemberCategory.DECLARED_FIELDS,
MemberCategory.PUBLIC_CLASSES, MemberCategory.PUBLIC_FIELDS,
MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS, MemberCategory.INVOKE_PUBLIC_METHODS);
});
reflection.registerTypes(typeReferences(classNames),
TypeHint.builtWith(MemberCategory.ACCESS_DECLARED_FIELDS, MemberCategory.ACCESS_PUBLIC_FIELDS,
MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS, MemberCategory.INVOKE_PUBLIC_METHODS));
}

private void registerJni(ReflectionHints jni) {
Expand Down