mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8284567: Collapse identical catch branches in java.base
Reviewed-by: darcy, iris, wetmore
This commit is contained in:
parent
40ddb7558c
commit
f4edb59a6e
17 changed files with 46 additions and 106 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2004, 2022, 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
|
||||
|
@ -92,8 +92,7 @@ public class NetProperties {
|
|||
String def = props.getProperty(key);
|
||||
try {
|
||||
return System.getProperty(key, def);
|
||||
} catch (IllegalArgumentException e) {
|
||||
} catch (NullPointerException e) {
|
||||
} catch (IllegalArgumentException | NullPointerException e) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -115,8 +114,7 @@ public class NetProperties {
|
|||
|
||||
try {
|
||||
val = System.getProperty(key, props.getProperty(key));
|
||||
} catch (IllegalArgumentException e) {
|
||||
} catch (NullPointerException e) {
|
||||
} catch (IllegalArgumentException | NullPointerException e) {
|
||||
}
|
||||
|
||||
if (val != null) {
|
||||
|
@ -144,8 +142,7 @@ public class NetProperties {
|
|||
|
||||
try {
|
||||
val = System.getProperty(key, props.getProperty(key));
|
||||
} catch (IllegalArgumentException e) {
|
||||
} catch (NullPointerException e) {
|
||||
} catch (IllegalArgumentException | NullPointerException e) {
|
||||
}
|
||||
|
||||
if (val != null) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1994, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1994, 2022, 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
|
||||
|
@ -510,17 +510,7 @@ public class FtpURLConnection extends URLConnection {
|
|||
is = new FtpInputStream(ftp, ftp.list(null));
|
||||
msgh.add("content-type", "text/plain");
|
||||
msgh.add("access-type", "directory");
|
||||
} catch (IOException ex) {
|
||||
FileNotFoundException fnfe = new FileNotFoundException(fullpath);
|
||||
if (ftp != null) {
|
||||
try {
|
||||
ftp.close();
|
||||
} catch (IOException ioe) {
|
||||
fnfe.addSuppressed(ioe);
|
||||
}
|
||||
}
|
||||
throw fnfe;
|
||||
} catch (FtpProtocolException ex2) {
|
||||
} catch (IOException | FtpProtocolException ex) {
|
||||
FileNotFoundException fnfe = new FileNotFoundException(fullpath);
|
||||
if (ftp != null) {
|
||||
try {
|
||||
|
|
|
@ -1465,9 +1465,6 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
|
|||
}
|
||||
return poster;
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
disconnectInternal();
|
||||
throw e;
|
||||
} catch (ProtocolException e) {
|
||||
// Save the response code which may have been set while enforcing
|
||||
// the 100-continue. disconnectInternal() forces it to -1
|
||||
|
@ -1475,7 +1472,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
|
|||
disconnectInternal();
|
||||
responseCode = i;
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
} catch (RuntimeException | IOException e) {
|
||||
disconnectInternal();
|
||||
throw e;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue