From 6a119468071021a287c855ecc6cdcbaedea5a539 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Tue, 26 Jun 2018 13:09:37 +0200 Subject: [PATCH 1/1] provide missing module's name via IllegalArgumentException by using orElseThrow() instead of get() on Optional in RpcUtil to help understand MDSAL-354 problem JIRA: MDSAL-354 Change-Id: If4d4f663b7cb63acea38acda73686176d27ff56f Signed-off-by: Michael Vorburger --- .../org/opendaylight/controller/blueprint/ext/RpcUtil.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/RpcUtil.java b/opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/RpcUtil.java index 9dbd019676..8f9e4ef6b2 100644 --- a/opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/RpcUtil.java +++ b/opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/RpcUtil.java @@ -36,7 +36,8 @@ final class RpcUtil { static Collection decomposeRpcService(final Class service, final SchemaContext schemaContext, final Predicate filter) { final QNameModule moduleName = BindingReflections.getQNameModule(service); - final Module module = schemaContext.findModule(moduleName).get(); + final Module module = schemaContext.findModule(moduleName).orElseThrow(() -> new IllegalArgumentException( + "Module not found in SchemaContext: " + moduleName + "; service: " + service)); LOG.debug("Resolved service {} to module {}", service, module); final Collection rpcs = module.getRpcs(); -- 2.36.6