Skip to content

Commit 9d6cd47

Browse files
Change to appropriate exceptions
1 parent d10cb10 commit 9d6cd47

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

closed/test/jdk/openj9/internal/security/TestConstraintsFailure.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
import java.security.KeyFactory;
3535
import java.security.KeyPairGenerator;
3636
import java.security.KeyStore;
37+
import java.security.KeyStoreException;
3738
import java.security.MessageDigest;
39+
import java.security.cert.CertificateException;
3840
import java.security.NoSuchAlgorithmException;
3941
import java.security.Signature;
4042
import java.security.cert.CertPathValidator;
@@ -60,7 +62,7 @@ private static void getInstances() throws Exception {
6062
try {
6163
CertificateFactory.getInstance("X.509");
6264
throw new RuntimeException("A NoSuchAlgorithmException should have been thrown");
63-
} catch(NoSuchAlgorithmException nsae) {
65+
} catch(CertificateException ce) {
6466
// Do nothing. This is expected.
6567
}
6668
try {
@@ -78,7 +80,7 @@ private static void getInstances() throws Exception {
7880
try {
7981
KeyStore.getInstance("PKCS12");
8082
throw new RuntimeException("A NoSuchAlgorithmException should have been thrown");
81-
} catch(NoSuchAlgorithmException nsae) {
83+
} catch(KeyStoreException ke) {
8284
// Do nothing. This is expected.
8385
}
8486

0 commit comments

Comments
 (0)