Combine identical catch blocks

This commit is contained in:
Ville Skyttä 2016-07-02 00:33:06 +03:00 committed by Clebert Suconic
parent 149216e8ec
commit f1dc94534f
6 changed files with 9 additions and 32 deletions

View File

@ -363,13 +363,7 @@ public class JSONObject {
}
}
}
catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
catch (JSONException e) {
throw new RuntimeException(e);
}
catch (InvocationTargetException e) {
catch (IllegalAccessException | InvocationTargetException | JSONException e) {
throw new RuntimeException(e);
}
}

View File

@ -891,10 +891,7 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
ActiveMQDestination.decomposeQueueNameForDurableSubscription(consumer.getQueue().getName().toString());
obj.put("durable", true);
}
catch (IllegalArgumentException e) {
obj.put("durable", false);
}
catch (JMSRuntimeException e) {
catch (IllegalArgumentException | JMSRuntimeException e) {
obj.put("durable", false);
}
}

View File

@ -956,10 +956,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
scheduleRetryConnect();
}
}
catch (ActiveMQInterruptedException e) {
ActiveMQServerLogger.LOGGER.errorConnectingBridge(e, this);
}
catch (InterruptedException e) {
catch (ActiveMQInterruptedException | InterruptedException e) {
ActiveMQServerLogger.LOGGER.errorConnectingBridge(e, this);
}
catch (Exception e) {
@ -1138,10 +1135,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
}
ActiveMQServerLogger.LOGGER.bridgeStopped(name);
}
catch (RuntimeException e) {
ActiveMQServerLogger.LOGGER.error("Failed to stop bridge", e);
}
catch (InterruptedException e) {
catch (InterruptedException | RuntimeException e) {
ActiveMQServerLogger.LOGGER.error("Failed to stop bridge", e);
}
}

View File

@ -120,11 +120,8 @@ public final class SharedStoreBackupActivation extends Activation {
startFailbackChecker();
}
}
catch (InterruptedException e) {
// this is ok, we are being stopped
}
catch (ClosedChannelException e) {
// this is ok too, we are being stopped
catch (ClosedChannelException | InterruptedException e) {
// these are ok, we are being stopped
}
catch (Exception e) {
if (!(e.getCause() instanceof InterruptedException)) {

View File

@ -90,9 +90,7 @@ public class GuestLoginModule implements LoginModule {
passwordCallback.clearPassword();
}
}
catch (IOException ioe) {
}
catch (UnsupportedCallbackException uce) {
catch (IOException | UnsupportedCallbackException e) {
}
}
if (debug) {

View File

@ -102,11 +102,8 @@ public class LDAPLoginModule implements LoginModule {
try {
handler.handle(callbacks);
}
catch (IOException ioe) {
throw (LoginException) new LoginException().initCause(ioe);
}
catch (UnsupportedCallbackException uce) {
throw (LoginException) new LoginException().initCause(uce);
catch (IOException | UnsupportedCallbackException e) {
throw (LoginException) new LoginException().initCause(e);
}
String password;