Skip to content

Commit

Permalink
[GR-29892] Add Bouncy Castle Native Image integration test.
Browse files Browse the repository at this point in the history
PullRequest: graal/8451
  • Loading branch information
cstancu committed Mar 11, 2021
2 parents 4cd9479 + baa8cfc commit abf3199
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,12 @@ final class Target_sun_security_provider_PolicyFile {
@SuppressWarnings({"unused", "static-method"})
final class Target_sun_security_jca_ProviderConfig {

@Alias @TargetElement(onlyWith = JDK11OrLater.class) //
private String provName;

@Alias @TargetElement(onlyWith = JDK8OrEarlier.class) //
private String className;

/**
* All security providers used in a native-image must be registered during image build time. At
* runtime, we shouldn't have a call to doLoadProvider. However, this method is still reachable
Expand All @@ -523,10 +529,16 @@ final class Target_sun_security_jca_ProviderConfig {
* {@link org.jcp.xml.dsig.internal.dom.XMLDSigRI}.
*/
@Substitute
private Provider doLoadProvider() {
throw VMError.unsupportedFeature("Cannot load new security provider at runtime.");
@TargetElement(name = "doLoadProvider", onlyWith = JDK11OrLater.class)
private Provider doLoadProviderJDK11OrLater() {
throw VMError.unsupportedFeature("Cannot load new security provider at runtime: " + provName + ".");
}

@Substitute
@TargetElement(name = "doLoadProvider", onlyWith = JDK8OrEarlier.class)
private Provider doLoadProviderJDK8OrEarlier() {
throw VMError.unsupportedFeature("Cannot load new security provider at runtime: " + className + ".");
}
}

@SuppressWarnings("unused")
Expand Down

0 comments on commit abf3199

Please sign in to comment.