Skip to content

Commit

Permalink
fix: add missing hints to fix native compilation (#19455) (#19457)
Browse files Browse the repository at this point in the history
* fix: add missing hints for native compilation

Add hints to register 'System' class methods for native image to allow
javax.imageio.ImageIO to be detected as used at runtime.

Fixes #19405

* fix: add missing native hints for LoginI18n.Header

Fixes #19405

Co-authored-by: Marco Collovati <marco@vaadin.com>
  • Loading branch information
vaadin-bot and mcollovati authored May 27, 2024
1 parent 1807850 commit b7f020a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public BeanFactoryInitializationAotContribution processAheadOfTime(
hasPWA = hasPWA || c.getAnnotation(PWA.class) != null;
}
if (hasPWA) {
hints.jni().registerType(
TypeReference.of("java.lang.System"),
MemberCategory.INVOKE_PUBLIC_METHODS);
for (String cls : getJNIClassesForPWA()) {
hints.jni().registerType(TypeReference.of(cls),
MemberCategory.values());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ private void registerResourceIfPresent(RuntimeHints hints, String path) {
// to ease testing
private String[] getCommonComponentClasses() {
return new String[] { "com.vaadin.flow.component.login.LoginI18n",
"com.vaadin.flow.component.login.LoginI18n$Header",
"com.vaadin.flow.component.login.LoginI18n$Form",
"com.vaadin.flow.component.login.LoginI18n$ErrorMessage",
"com.vaadin.flow.component.messages.MessageListItem" };
Expand Down

0 comments on commit b7f020a

Please sign in to comment.