BUG-731: Declare which exceptions are possible from callable 56/7156/1
authorRobert Varga <rovarga@cisco.com>
Sun, 18 May 2014 13:40:02 +0000 (15:40 +0200)
committerRobert Varga <rovarga@cisco.com>
Sun, 18 May 2014 14:28:38 +0000 (16:28 +0200)
This just makes it clear that it's not Exception which is being thrown.

Change-Id: Ic7fc356f38a8faa943fcc222079a3a680e15c818
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/util/BindingReflections.java

index a6c3996c5cd22558e44f42ea4283c869f84b9ea4..5e1494c55e7d27b6a620ccba5fe9aab318560448 100644 (file)
@@ -12,6 +12,7 @@ import static com.google.common.base.Preconditions.checkState;
 import static org.opendaylight.yangtools.concepts.util.ClassLoaderUtils.withClassLoader;
 
 import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
 import java.util.ServiceLoader;
@@ -124,7 +125,6 @@ public class BindingReflections {
                     YangModuleInfo moduleInfo = getModuleInfo(key);
                     return Optional.of(QName.create(moduleInfo.getNamespace(), moduleInfo.getRevision(), moduleInfo.getName()));
                 }
-
             } catch (SecurityException | IllegalArgumentException | IllegalAccessException e) {
                 // NOOP
             }
@@ -205,7 +205,7 @@ public class BindingReflections {
         return withClassLoader(cls.getClassLoader(), new Callable<YangModuleInfo>() {
 
             @Override
-            public YangModuleInfo call() throws Exception {
+            public YangModuleInfo call() throws ClassNotFoundException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
                 Class<?> moduleInfoClass = Thread.currentThread().getContextClassLoader().loadClass(potentialClassName);
                 return (YangModuleInfo) moduleInfoClass.getMethod("getInstance").invoke(null);
             }