Skip to content

Commit

Permalink
Fix return types of substitutions
Browse files Browse the repository at this point in the history
Resolves issues with new strict checking introduced with
oracle/graal#7340
  • Loading branch information
zakkak committed Sep 12, 2023
1 parent 9bfc508 commit 4319465
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)) {
Expand All @@ -34,4 +36,10 @@ public ClientHttpEngineBuilder43Replacement resteasyClientBuilder(ResteasyClient
}
return this;
}

/**
* Unused alias to implement the {@link ClientHttpEngineBuilder} interface
*/
@Alias
public native ClientHttpEngine build();
}

0 comments on commit 4319465

Please sign in to comment.