Skip to content

Commit

Permalink
Restructure hints.
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaMaciaszek committed Dec 5, 2023
1 parent 159c94a commit 8b9f95d
Showing 1 changed file with 23 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,31 +69,34 @@ public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
TypeReference.of(PropertyValueDescriptor.class)),
hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS));
hints.reflection().registerTypes(
Set.of(TypeReference.of(PropertyValueDescriptor.class), TypeReference.of(Mac.class),
TypeReference.of(KeyAgreement.class), TypeReference.of(KeyPairGenerator.class),
TypeReference.of(KeyFactory.class), TypeReference.of(Signature.class),
TypeReference.of(MessageDigest.class)),
hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_METHODS));
Set.of(TypeReference.of(PropertyValueDescriptor.class), TypeReference.of(Mac.class),
TypeReference.of(KeyAgreement.class), TypeReference.of(KeyPairGenerator.class),
TypeReference.of(KeyFactory.class), TypeReference.of(Signature.class),
TypeReference.of(MessageDigest.class)),
hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_METHODS));

// TODO: move over to GraalVM reachability metadata
if (ClassUtils.isPresent("org.apache.sshd.common.SshConstants", classLoader)) {
hints.reflection()
.registerTypes(Set.of(TypeReference.of(BouncyCastleSecurityProviderRegistrar.class),
TypeReference.of(EdDSASecurityProviderRegistrar.class), TypeReference.of(SshdText.class),
TypeReference.of(Nio2ServiceFactory.class), TypeReference.of(Nio2ServiceFactoryFactory.class)),
hints.reflection().registerTypes(Set.of(TypeReference.of(BouncyCastleSecurityProviderRegistrar.class),
TypeReference.of(EdDSASecurityProviderRegistrar.class), TypeReference.of(Nio2ServiceFactory.class),
TypeReference.of(Nio2ServiceFactoryFactory.class)),
hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS));
hints.reflection()
.registerTypes(Set.of(TypeReference.of(MergeCommand.FastForwardMode.Merge.class),
TypeReference.of(MergeCommand.ConflictStyle.class),
TypeReference.of(MergeCommand.FastForwardMode.class), TypeReference.of(FetchCommand.class)),
hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_METHODS));
hints.reflection()
.registerTypes(Set.of(TypeReference.of(PortForwardingEventListener.class)),
hints.reflection().registerTypes(Set.of(TypeReference.of(PortForwardingEventListener.class)),
hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.DECLARED_FIELDS));
MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.DECLARED_FIELDS));
hints.proxies().registerJdkProxy(TypeReference.of(ChannelListener.class),
TypeReference.of(PortForwardingEventListener.class), TypeReference.of(SessionListener.class));
}

// TODO: move over to GraalVM reachability metadata
if (ClassUtils.isPresent("org.eclipse.jgit.api.Git", classLoader)) {
hints.reflection()
.registerTypes(Set.of(TypeReference.of(SshdText.class)), hint -> hint
.registerTypes(Set.of(TypeReference.of(MergeCommand.FastForwardMode.Merge.class),
TypeReference.of(MergeCommand.ConflictStyle.class),
TypeReference.of(MergeCommand.FastForwardMode.class), TypeReference.of(FetchCommand.class)),
hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_METHODS));
hints.reflection().registerTypes(Set.of(TypeReference.of(SshdText.class)), hint -> hint
.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS));
hints.proxies().registerJdkProxy(TypeReference.of(ChannelListener.class),
TypeReference.of(PortForwardingEventListener.class), TypeReference.of(SessionListener.class));
}
}

Expand Down

0 comments on commit 8b9f95d

Please sign in to comment.