From a3891f5c489883336f1ac92372befff8842970d0 Mon Sep 17 00:00:00 2001 From: Thomas Bachman Date: Sat, 1 Aug 2015 16:21:17 -0400 Subject: [PATCH] Bug-3836: Don't catch Throwable (use Exception). Throwables shouldn't be caught, and the code should instead catch Exceptions. This patch fixes bugs of this kind that were found by sonar. Change-Id: If9eda19712141107efea6b4432cdb6b4d5c8bf29 Signed-off-by: Thomas Bachman --- .../endpoint/EndpointRpcRegistry.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/groupbasedpolicy/src/main/java/org/opendaylight/groupbasedpolicy/endpoint/EndpointRpcRegistry.java b/groupbasedpolicy/src/main/java/org/opendaylight/groupbasedpolicy/endpoint/EndpointRpcRegistry.java index d79389112..5af2ff349 100644 --- a/groupbasedpolicy/src/main/java/org/opendaylight/groupbasedpolicy/endpoint/EndpointRpcRegistry.java +++ b/groupbasedpolicy/src/main/java/org/opendaylight/groupbasedpolicy/endpoint/EndpointRpcRegistry.java @@ -229,9 +229,9 @@ public class EndpointRpcRegistry implements EndpointService { Class> augmentationType = (Class>) getAugmentationContextType(augmentation); eb.addAugmentation(augmentationType, augmentation); } - } catch (Throwable t) { + } catch (Exception e) { LOG.warn("Endpoint Augmentation error while processing " - + entry.getKey() + ". Reason: ", t); + + entry.getKey() + ". Reason: ", e); } } return eb; @@ -257,9 +257,9 @@ public class EndpointRpcRegistry implements EndpointService { Class> augmentationType = (Class>) getAugmentationContextType(augmentation); eb.addAugmentation(augmentationType, augmentation); } - } catch (Throwable t) { + } catch (Exception e) { LOG.warn("L3 endpoint Augmentation error while processing " - + entry.getKey() + ". Reason: ", t); + + entry.getKey() + ". Reason: ", e); } } return eb; @@ -279,9 +279,9 @@ public class EndpointRpcRegistry implements EndpointService { .entrySet()) { try { entry.getValue().buildL3PrefixEndpointAugmentation(eb, input); - } catch (Throwable t) { + } catch (Exception e) { LOG.warn("L3 endpoint Augmentation error while processing " - + entry.getKey() + ". Reason: ", t); + + entry.getKey() + ". Reason: ", e); } } return eb; -- 2.36.6