@@ -166,8 +166,12 @@ public static class Options {
166
166
CertPathBuilder .class , CertPathValidator .class , CertStore .class , CertificateFactory .class ,
167
167
Cipher .class , Configuration .class , KeyAgreement .class , KeyFactory .class ,
168
168
KeyGenerator .class , KeyManagerFactory .class , KeyPairGenerator .class ,
169
- KeyStore .class , Mac .class , MessageDigest .class , Policy . class , SSLContext .class ,
169
+ KeyStore .class , Mac .class , MessageDigest .class , SSLContext .class ,
170
170
SecretKeyFactory .class , SecureRandom .class , Signature .class , TrustManagerFactory .class ));
171
+ if (JavaVersionUtil .JAVA_SPEC <= 21 ) {
172
+ // JDK-8338411: Implement JEP 486: Permanently Disable the Security Manager
173
+ classList .add (Policy .class );
174
+ }
171
175
172
176
if (ModuleLayer .boot ().findModule ("java.security.sasl" ).isPresent ()) {
173
177
classList .add (ReflectionUtil .lookupClass (false , "javax.security.sasl.SaslClientFactory" ));
@@ -634,6 +638,7 @@ private void registerServices(DuringAnalysisAccess access, Object trigger, Strin
634
638
private void doRegisterServices (DuringAnalysisAccess access , Object trigger , String serviceType ) {
635
639
try (TracingAutoCloseable ignored = trace (access , trigger , serviceType )) {
636
640
Set <Service > services = availableServices .get (serviceType );
641
+ VMError .guarantee (services != null );
637
642
for (Service service : services ) {
638
643
registerService (access , service );
639
644
}
0 commit comments