From 431946530fafc3ced2e5bd8a15b8669ccfcc60b4 Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Mon, 11 Sep 2023 15:13:29 +0300 Subject: [PATCH] Fix return types of substitutions Resolves issues with new strict checking introduced with https://github.com/oracle/graal/pull/7340 --- .../java/io/quarkus/runtime/graal/AwtImageIO.java | 4 ++-- .../graal/ClientHttpEngineBuilder43Replacement.java | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/core/runtime/src/main/java/io/quarkus/runtime/graal/AwtImageIO.java b/core/runtime/src/main/java/io/quarkus/runtime/graal/AwtImageIO.java index c16d2c4a5d12a..14bc91f9f7597 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/graal/AwtImageIO.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/graal/AwtImageIO.java @@ -1,6 +1,6 @@ package io.quarkus.runtime.graal; -import java.awt.Graphics; +import java.awt.GraphicsEnvironment; import java.awt.Toolkit; import java.util.Iterator; import java.util.function.BooleanSupplier; @@ -41,7 +41,7 @@ public boolean getAsBoolean() { @TargetClass(className = "java.awt.GraphicsEnvironment", onlyWith = AwtImageIO.IsAWTAbsent.class) final class Target_java_awt_GraphicsEnvironment { @Substitute - public static Graphics getLocalGraphicsEnvironment() { + public static GraphicsEnvironment getLocalGraphicsEnvironment() { throw new UnsupportedOperationException(AwtImageIO.AWT_EXTENSION_HINT); } diff --git a/extensions/resteasy-classic/rest-client/runtime/src/main/java/io/quarkus/restclient/runtime/graal/ClientHttpEngineBuilder43Replacement.java b/extensions/resteasy-classic/rest-client/runtime/src/main/java/io/quarkus/restclient/runtime/graal/ClientHttpEngineBuilder43Replacement.java index 7fba4adb63931..050a5b54eae12 100644 --- a/extensions/resteasy-classic/rest-client/runtime/src/main/java/io/quarkus/restclient/runtime/graal/ClientHttpEngineBuilder43Replacement.java +++ b/extensions/resteasy-classic/rest-client/runtime/src/main/java/io/quarkus/restclient/runtime/graal/ClientHttpEngineBuilder43Replacement.java @@ -4,6 +4,8 @@ import javax.net.ssl.SSLContext; +import org.jboss.resteasy.client.jaxrs.ClientHttpEngine; +import org.jboss.resteasy.client.jaxrs.ClientHttpEngineBuilder; import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; import com.oracle.svm.core.annotate.Alias; @@ -16,13 +18,13 @@ * {@code SSLContext.getInstance(SSLConnectionSocketFactory.TLS)} which will fail in native when the SSL has been disabled */ @TargetClass(className = "org.jboss.resteasy.client.jaxrs.engines.ClientHttpEngineBuilder43") -public final class ClientHttpEngineBuilder43Replacement { +public final class ClientHttpEngineBuilder43Replacement implements ClientHttpEngineBuilder { @Alias private ResteasyClientBuilder that; @Substitute - public ClientHttpEngineBuilder43Replacement resteasyClientBuilder(ResteasyClientBuilder resteasyClientBuilder) { + public ClientHttpEngineBuilder resteasyClientBuilder(ResteasyClientBuilder resteasyClientBuilder) { that = resteasyClientBuilder; // make sure we only set a context if there is none or one wouldn't be created implicitly if ((that.getSSLContext() == null) && (that.getTrustStore() == null) && (that.getKeyStore() == null)) { @@ -34,4 +36,10 @@ public ClientHttpEngineBuilder43Replacement resteasyClientBuilder(ResteasyClient } return this; } + + /** + * Unused alias to implement the {@link ClientHttpEngineBuilder} interface + */ + @Alias + public native ClientHttpEngine build(); }