Skip to content

Commit 2bc8072

Browse files
authored
fix: add missing hints to fix native compilation (#19455)
* 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
1 parent 74164b2 commit 2bc8072

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎vaadin-spring/src/main/java/com/vaadin/flow/spring/springnative/VaadinBeanFactoryInitializationAotProcessor.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ public BeanFactoryInitializationAotContribution processAheadOfTime(
8080
hasPWA = hasPWA || c.getAnnotation(PWA.class) != null;
8181
}
8282
if (hasPWA) {
83+
hints.jni().registerType(
84+
TypeReference.of("java.lang.System"),
85+
MemberCategory.INVOKE_PUBLIC_METHODS);
8386
for (String cls : getJNIClassesForPWA()) {
8487
hints.jni().registerType(TypeReference.of(cls),
8588
MemberCategory.values());

‎vaadin-spring/src/main/java/com/vaadin/flow/spring/springnative/VaadinHintsRegistrar.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ private void registerResourceIfPresent(RuntimeHints hints, String path) {
5656
// to ease testing
5757
private String[] getCommonComponentClasses() {
5858
return new String[] { "com.vaadin.flow.component.login.LoginI18n",
59+
"com.vaadin.flow.component.login.LoginI18n$Header",
5960
"com.vaadin.flow.component.login.LoginI18n$Form",
6061
"com.vaadin.flow.component.login.LoginI18n$ErrorMessage",
6162
"com.vaadin.flow.component.messages.MessageListItem" };

0 commit comments

Comments
 (0)