mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8274079: Cleanup unnecessary calls to Throwable.initCause() in java.base module
Reviewed-by: weijun
This commit is contained in:
parent
8609ea55ac
commit
1459180f35
22 changed files with 55 additions and 132 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -184,8 +184,7 @@ abstract class DigestBase extends MessageDigestSpi implements Cloneable {
|
|||
try {
|
||||
engineDigest(b, 0, b.length);
|
||||
} catch (DigestException e) {
|
||||
throw (ProviderException)
|
||||
new ProviderException("Internal error").initCause(e);
|
||||
throw new ProviderException("Internal error", e);
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
|
|
@ -810,9 +810,9 @@ public abstract class JavaKeyStore extends KeyStoreSpi {
|
|||
if (!MessageDigest.isEqual(computed, actual)) {
|
||||
Throwable t = new UnrecoverableKeyException
|
||||
("Password verification failed");
|
||||
throw (IOException) new IOException
|
||||
throw new IOException
|
||||
("Keystore was tampered with, or "
|
||||
+ "password was incorrect").initCause(t);
|
||||
+ "password was incorrect", t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -254,8 +254,7 @@ public class HostnameChecker {
|
|||
return new X500Name(subjectX500.getEncoded());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw(CertificateParsingException)
|
||||
new CertificateParsingException().initCause(e);
|
||||
throw new CertificateParsingException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue