From 15f24f8d9afd9fd9190fa4ed3eb1d6fb44ad89e3 Mon Sep 17 00:00:00 2001 From: Martin Bobak Date: Sat, 16 May 2015 12:59:39 +0200 Subject: [PATCH] fixed npes in service processing and message spying Change-Id: I607200b0ac2a9324c44c2460a6c633000f0029f1 Signed-off-by: Martin Bobak --- .../openflowplugin/impl/services/CommonService.java | 2 +- .../impl/services/NodeConfigServiceImpl.java | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/CommonService.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/CommonService.java index 706a46d25f..c17cb0285b 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/CommonService.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/CommonService.java @@ -109,7 +109,7 @@ public abstract class CommonService { final RequestContext requestContext = createRequestContext(); if (requestContext == null) { LOG.trace("Request context refused."); - deviceContext.getMessageSpy().spyMessage(null, MessageSpy.STATISTIC_GROUP.TO_SWITCH_DISREGARDED); + deviceContext.getMessageSpy().spyMessage(CommonService.class, MessageSpy.STATISTIC_GROUP.TO_SWITCH_DISREGARDED); return failedFuture(); } diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/NodeConfigServiceImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/NodeConfigServiceImpl.java index 8b0f1b74d3..4c3442b384 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/NodeConfigServiceImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/NodeConfigServiceImpl.java @@ -8,8 +8,6 @@ package org.opendaylight.openflowplugin.impl.services; import com.google.common.util.concurrent.FutureCallback; -import com.google.common.util.concurrent.JdkFutureAdapters; -import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; import java.util.concurrent.Future; import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueue; @@ -45,12 +43,8 @@ public class NodeConfigServiceImpl extends CommonService implements NodeConfigSe SetConfigInputBuilder builder = new SetConfigInputBuilder(); SwitchConfigFlag flag = SwitchConfigFlag.valueOf(input.getFlag()); - final Long reservedXid = getDeviceContext().getReservedXid(); - if (null == reservedXid) { - return RequestContextUtil.closeRequestContextWithRpcError(requestContext, "Outbound queue wasn't able to reserve XID."); - } - final Xid xid = new Xid(reservedXid); + final Xid xid = requestContext.getXid(); builder.setXid(xid.getValue()); builder.setFlags(flag); builder.setMissSendLen(input.getMissSearchLength()); -- 2.36.6