Collapse catch clauses

Use multi-catch for exceptions whenever possible.

See gh-9781
This commit is contained in:
Emanuel Campolo
2017-07-18 11:52:47 -03:00
committed by Phillip Webb
parent 4a189bdee7
commit 798fe5ed53
17 changed files with 19 additions and 76 deletions

View File

@@ -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;

View File

@@ -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;