- /**
- * Computes QName for supplied class
- *
- * Namespace and revision are same as {@link YangModuleInfo} associated with
- * supplied class.
- * <p>
- * If class is
- * <ul>
- * <li>rpc input: local name is "input".
- * <li>rpc output: local name is "output".
- * <li>augmentation: local name is "module name".
- * </ul>
- *
- * There is also fallback, if it is not possible to compute QName using
- * following algorithm returns module QName.
- *
- * FIXME: Extend this algorithm to also provide QName for YANG modeled
- * simple types.
- *
- * @throws IllegalStateException
- * If YangModuleInfo could not be resolved
- * @throws IllegalArgumentException
- * If supplied class was not derived from YANG model.
- *
- */
- @SuppressWarnings({ "rawtypes", "unchecked" })
- private static QName computeQName(final Class key) {
- if (isBindingClass(key)) {
- YangModuleInfo moduleInfo;
- try {
- moduleInfo = getModuleInfo(key);
- } catch (Exception e) {
- throw new IllegalStateException("Unable to get QName for " + key + ". YangModuleInfo was not found.", e);
+ } catch (SecurityException | IllegalArgumentException | IllegalAccessException e) {
+ /*
+ *
+ * It is safe to log this this exception on debug, since this method
+ * should not fail. Only failures are possible if the runtime /
+ * backing.
+ */
+ LOG.debug("Unexpected exception during extracting QName for {}", key, e);