mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
6850612: Deprecate Class.newInstance since it violates the checked exception language contract
Reviewed-by: lancea, mullan, dfuchs
This commit is contained in:
parent
e8cd76568d
commit
01ee88c8ae
71 changed files with 272 additions and 157 deletions
|
@ -185,7 +185,9 @@ final class ProviderConfig {
|
|||
try {
|
||||
Class<?> c = Class.forName("apple.security.AppleProvider");
|
||||
if (Provider.class.isAssignableFrom(c)) {
|
||||
return (Provider) c.newInstance();
|
||||
@SuppressWarnings("deprecation")
|
||||
Object tmp = c.newInstance();
|
||||
return (Provider) tmp;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
@ -386,6 +388,7 @@ final class ProviderConfig {
|
|||
|
||||
Provider p = AccessController.doPrivileged
|
||||
(new PrivilegedExceptionAction<Provider>() {
|
||||
@SuppressWarnings("deprecation") // Class.newInstance
|
||||
public Provider run() throws Exception {
|
||||
return (Provider) provClass.newInstance();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue