Skip to content

Commit

Permalink
Merge pull request #35847 from zakkak/2023-09-11-fix-return-type-mism…
Browse files Browse the repository at this point in the history
…atch

Fix return types of substitutions
  • Loading branch information
zakkak authored Sep 12, 2023
2 parents a3acb86 + 4319465 commit db0ddb5
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 db0ddb5

Please sign in to comment.