Collapse catch clauses
Use multi-catch for exceptions whenever possible. See gh-9781
This commit is contained in:
committed by
Phillip Webb
parent
4a189bdee7
commit
798fe5ed53
@@ -80,10 +80,7 @@ public class ClassPathChangeUploader
|
||||
try {
|
||||
this.uri = new URL(url).toURI();
|
||||
}
|
||||
catch (URISyntaxException ex) {
|
||||
throw new IllegalArgumentException("Malformed URL '" + url + "'");
|
||||
}
|
||||
catch (MalformedURLException ex) {
|
||||
catch (URISyntaxException | MalformedURLException ex) {
|
||||
throw new IllegalArgumentException("Malformed URL '" + url + "'");
|
||||
}
|
||||
this.requestFactory = requestFactory;
|
||||
|
||||
@@ -84,10 +84,7 @@ public class HttpTunnelConnection implements TunnelConnection {
|
||||
try {
|
||||
this.uri = new URL(url).toURI();
|
||||
}
|
||||
catch (URISyntaxException ex) {
|
||||
throw new IllegalArgumentException("Malformed URL '" + url + "'");
|
||||
}
|
||||
catch (MalformedURLException ex) {
|
||||
catch (URISyntaxException | MalformedURLException ex) {
|
||||
throw new IllegalArgumentException("Malformed URL '" + url + "'");
|
||||
}
|
||||
this.requestFactory = requestFactory;
|
||||
|
||||
Reference in New Issue
Block a user