sonar: use dedicated exception instead of RuntimeException
[neutron.git] / northbound-api / src / main / java / org / opendaylight / neutron / northbound / api / INeutronRequest.java
index 32cf45ab8c84fbac2e532faddca5cc55c8ecea5c..6430254a593dad23a023410ab2272d424a5e1f58 100644 (file)
@@ -20,7 +20,7 @@ public interface INeutronRequest<T extends INeutronObject<T>> {
             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<T extends INeutronObject<T>> {
             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<T extends INeutronObject<T>> {
             Field field = aClass.getDeclaredField("bulkRequest");
             return (List<T>) field.get(this);
         } catch (IllegalAccessException | NoSuchFieldException e) {
-            throw new RuntimeException(e);
+            throw new IllegalArgumentException(e);
         }
     }
 }