From 612d731a3cf7535bc9ab9f8c582522ed079ffcfd Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Thu, 6 Oct 2016 10:56:54 -0700 Subject: [PATCH] sonar: use dedicated exception instead of RuntimeException use IllegalArgumentException instead of RuntimeException Change-Id: I32c17078499ff3cfd17f2d3b445a3e1bdac99574 Signed-off-by: Isaku Yamahata --- .../neutron/northbound/api/AbstractNeutronNorthbound.java | 2 +- .../neutron/northbound/api/INeutronRequest.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/AbstractNeutronNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/AbstractNeutronNorthbound.java index c5160a000..20788c629 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/AbstractNeutronNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/AbstractNeutronNorthbound.java @@ -55,7 +55,7 @@ public abstract class AbstractNeutronNorthbound, Neu } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) { // This case shouldn't happen - throw new RuntimeException(e); + throw new IllegalArgumentException(e); } } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/INeutronRequest.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/INeutronRequest.java index 32cf45ab8..6430254a5 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/INeutronRequest.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/INeutronRequest.java @@ -20,7 +20,7 @@ public interface INeutronRequest> { Field field = aClass.getDeclaredField("singleton"); return (T) field.get(this); } catch (IllegalAccessException | NoSuchFieldException e) { - throw new RuntimeException(e); + throw new IllegalArgumentException(e); } } @@ -31,7 +31,7 @@ public interface INeutronRequest> { Field field = aClass.getDeclaredField("singleton"); return field.get(this) != null; } catch (IllegalAccessException | NoSuchFieldException e) { - throw new RuntimeException(e); + throw new IllegalArgumentException(e); } } @@ -42,7 +42,7 @@ public interface INeutronRequest> { Field field = aClass.getDeclaredField("bulkRequest"); return (List) field.get(this); } catch (IllegalAccessException | NoSuchFieldException e) { - throw new RuntimeException(e); + throw new IllegalArgumentException(e); } } } -- 2.36.6