fix deprecations

This commit is contained in:
zzz
2018-08-25 13:26:28 +00:00
parent ff551b19fb
commit c3881a811b
5 changed files with 21 additions and 20 deletions

View File

@ -125,11 +125,10 @@ public final class Noise {
static void throwBadTagException() throws BadPaddingException
{
try {
// java since 1.7; android since API 19
Class<?> c = Class.forName("javax.crypto.AEADBadTagException");
throw (BadPaddingException)(c.newInstance());
} catch (ClassNotFoundException e) {
} catch (InstantiationException e) {
} catch (IllegalAccessException e) {
throw (BadPaddingException)(c.getDeclaredConstructor().newInstance());
} catch (Exception e) {
}
throw new BadPaddingException();
}