修复NoSuchMethodError未捕获问题

This commit is contained in:
Looly 2023-03-09 20:00:13 +08:00
parent 914a7b700c
commit 50c07dd4d8
2 changed files with 5 additions and 1 deletions

View File

@ -7,6 +7,7 @@
### 🐣新特性
### 🐞Bug修复
* 【crypto】 修复NoSuchMethodError未捕获问题issue#2966@Github
-------------------------------------------------------------------------------------------------------------
# 5.8.15 (2023-03-09)

View File

@ -8,6 +8,9 @@ import java.security.Provider;
* @author looly
*/
public enum GlobalBouncyCastleProvider {
/**
* 单例
*/
INSTANCE;
private Provider provider;
@ -16,7 +19,7 @@ public enum GlobalBouncyCastleProvider {
GlobalBouncyCastleProvider() {
try {
this.provider = ProviderFactory.createBouncyCastleProvider();
} catch (NoClassDefFoundError e) {
} catch (NoClassDefFoundError | NoSuchMethodError e) {
// ignore
}
}