From 69c8d4536858ef685a2fe93763475b182380bbb6 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Sat, 16 May 2015 18:29:25 +0200 Subject: [PATCH] Fix RpcResultBuilder/RpcContext raw references This adds proper type arguments to eliminate eclipse warnings. Change-Id: I63373fadd17c1f99f8e8e465190adc65a2597a0a Signed-off-by: Robert Varga --- .../FlowCapableTransactionServiceImpl.java | 2 +- .../impl/services/NodeConfigServiceImpl.java | 2 +- .../services/PacketProcessingServiceImpl.java | 3 ++- .../impl/services/SalEchoServiceImpl.java | 2 +- .../impl/services/SalFlowServiceImpl.java | 16 ++++++++-------- .../impl/services/SalGroupServiceImpl.java | 4 ++-- .../impl/services/SalMeterServiceImpl.java | 4 ++-- .../impl/services/SalPortServiceImpl.java | 2 +- .../impl/services/SalTableServiceImpl.java | 6 +++--- .../dedicated/StatisticsGatheringService.java | 2 +- 10 files changed, 22 insertions(+), 21 deletions(-) diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/FlowCapableTransactionServiceImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/FlowCapableTransactionServiceImpl.java index 79db452d37..e42707bc18 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/FlowCapableTransactionServiceImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/FlowCapableTransactionServiceImpl.java @@ -68,7 +68,7 @@ public class FlowCapableTransactionServiceImpl extends CommonService implements @Override public void onFailure(final Throwable throwable) { - RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION, throwable.getMessage(), throwable); + RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION, throwable.getMessage(), throwable); RequestContextUtil.closeRequstContext(requestContext); getDeviceContext().unhookRequestCtx(requestContext.getXid()); getMessageSpy().spyMessage(barrierInput.getImplementedInterface(), MessageSpy.STATISTIC_GROUP.TO_SWITCH_SUBMIT_FAILURE); 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 8bbf60daf3..2de9813781 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 @@ -64,7 +64,7 @@ public class NodeConfigServiceImpl extends CommonService implements NodeConfigSe @Override public void onFailure(final Throwable throwable) { - RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION, throwable.getMessage(), throwable); + RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION, throwable.getMessage(), throwable); RequestContextUtil.closeRequstContext(requestContext); getDeviceContext().unhookRequestCtx(requestContext.getXid()); getMessageSpy().spyMessage(setConfigInput.getImplementedInterface(), MessageSpy.STATISTIC_GROUP.TO_SWITCH_SUBMIT_FAILURE); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/PacketProcessingServiceImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/PacketProcessingServiceImpl.java index 272762b0ba..2308fc126b 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/PacketProcessingServiceImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/PacketProcessingServiceImpl.java @@ -50,7 +50,8 @@ public class PacketProcessingServiceImpl extends CommonService implements Packet @Override public void onSuccess(final OfHeader ofHeader) { if (ofHeader instanceof RpcResult) { - RpcResult rpcResult = (RpcResult) ofHeader; + @SuppressWarnings("unchecked") + RpcResult rpcResult = (RpcResult) ofHeader; if (!rpcResult.isSuccessful()) { getMessageSpy().spyMessage(message.getImplementedInterface(), MessageSpy.STATISTIC_GROUP.TO_SWITCH_SUBMIT_FAILURE); settableFuture.set(rpcResult); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalEchoServiceImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalEchoServiceImpl.java index dd160c2131..8d6fe647ae 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalEchoServiceImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalEchoServiceImpl.java @@ -73,7 +73,7 @@ public class SalEchoServiceImpl extends CommonService implements SalEchoService @Override public void onFailure(final Throwable throwable) { - RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION, throwable.getMessage(), throwable); + RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION, throwable.getMessage(), throwable); RequestContextUtil.closeRequstContext(requestContext); getDeviceContext().unhookRequestCtx(requestContext.getXid()); getMessageSpy().spyMessage(echoInputOFJava.getImplementedInterface(), MessageSpy.STATISTIC_GROUP.TO_SWITCH_SUBMIT_FAILURE); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalFlowServiceImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalFlowServiceImpl.java index 27532be7b7..7bf54bcb22 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalFlowServiceImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalFlowServiceImpl.java @@ -107,9 +107,9 @@ public class SalFlowServiceImpl extends CommonService implements SalFlowService final FlowModInputBuilder ofFlowModInput = FlowConvertor.toFlowModInput(input, getVersion(), getDatapathId()); final ListenableFuture> future = createResultForFlowMod(requestContext, ofFlowModInput); - Futures.addCallback(future, new FutureCallback() { + Futures.addCallback(future, new FutureCallback>() { @Override - public void onSuccess(final Object o) { + public void onSuccess(final RpcResult o) { final DeviceContext deviceContext = getDeviceContext(); getMessageSpy().spyMessage(input.getImplementedInterface(), MessageSpy.STATISTIC_GROUP.TO_SWITCH_SUBMIT_SUCCESS); FlowHash flowHash = FlowHashFactory.create(input, deviceContext.getPrimaryConnectionContext().getFeatures().getVersion()); @@ -166,10 +166,10 @@ public class SalFlowServiceImpl extends CommonService implements SalFlowService } allFlowMods.addAll(ofFlowModInputs); - ListenableFuture future = processFlowModInputBuilders(allFlowMods); - Futures.addCallback(future, new FutureCallback() { + ListenableFuture> future = processFlowModInputBuilders(allFlowMods); + Futures.addCallback(future, new FutureCallback>() { @Override - public void onSuccess(final Object o) { + public void onSuccess(final RpcResult o) { final DeviceContext deviceContext = getDeviceContext(); getMessageSpy().spyMessage(input.getImplementedInterface(), MessageSpy.STATISTIC_GROUP.TO_SWITCH_SUBMIT_SUCCESS); final short version = deviceContext.getPrimaryConnectionContext().getFeatures().getVersion(); @@ -211,13 +211,13 @@ public class SalFlowServiceImpl extends CommonService implements SalFlowService Futures.addCallback(allFutures, new FutureCallback>>() { @Override public void onSuccess(final List> results) { - RpcResultBuilder rpcResultBuilder = RpcResultBuilder.success(); + RpcResultBuilder rpcResultBuilder = RpcResultBuilder.success(); finalFuture.set(rpcResultBuilder.build()); } @Override public void onFailure(final Throwable t) { - RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed(); + RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed(); finalFuture.set(rpcResultBuilder.build()); } }); @@ -244,7 +244,7 @@ public class SalFlowServiceImpl extends CommonService implements SalFlowService @Override public void onFailure(final Throwable throwable) { - RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(ErrorType.APPLICATION, throwable.getMessage(), throwable); + RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(ErrorType.APPLICATION, throwable.getMessage(), throwable); RequestContextUtil.closeRequstContext(requestContext); getDeviceContext().unhookRequestCtx(requestContext.getXid()); settableFuture.set(rpcResultBuilder.build()); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalGroupServiceImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalGroupServiceImpl.java index 29df1d8a90..54a772e1f9 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalGroupServiceImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalGroupServiceImpl.java @@ -38,7 +38,7 @@ import org.slf4j.Logger; public class SalGroupServiceImpl extends CommonService implements SalGroupService { - public SalGroupServiceImpl(RequestContextStack requestContextStack, DeviceContext deviceContext) { + public SalGroupServiceImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext) { super(requestContextStack, deviceContext); } @@ -98,7 +98,7 @@ public class SalGroupServiceImpl extends CommonService implements SalGroupServic @Override public void onFailure(final Throwable throwable) { - RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION, throwable.getMessage(), throwable); + RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION, throwable.getMessage(), throwable); RequestContextUtil.closeRequstContext(requestContext); getDeviceContext().unhookRequestCtx(requestContext.getXid()); getMessageSpy().spyMessage(groupModInput.getImplementedInterface(), MessageSpy.STATISTIC_GROUP.TO_SWITCH_SUBMIT_FAILURE); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalMeterServiceImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalMeterServiceImpl.java index 87b5491eec..0dc9a16f74 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalMeterServiceImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalMeterServiceImpl.java @@ -39,7 +39,7 @@ public class SalMeterServiceImpl extends CommonService implements SalMeterServic private static final Logger LOG = org.slf4j.LoggerFactory.getLogger(SalMeterServiceImpl.class); - public SalMeterServiceImpl(RequestContextStack requestContextStack, DeviceContext deviceContext) { + public SalMeterServiceImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext) { super(requestContextStack, deviceContext); } @@ -96,7 +96,7 @@ public class SalMeterServiceImpl extends CommonService implements SalMeterServic @Override public void onFailure(final Throwable throwable) { - RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION, throwable.getMessage(), throwable); + RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION, throwable.getMessage(), throwable); RequestContextUtil.closeRequstContext(requestContext); getDeviceContext().unhookRequestCtx(requestContext.getXid()); getMessageSpy().spyMessage(meterModInput.getImplementedInterface(), MessageSpy.STATISTIC_GROUP.TO_SWITCH_SUBMIT_FAILURE); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalPortServiceImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalPortServiceImpl.java index a214b46ae4..0857eb3ead 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalPortServiceImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalPortServiceImpl.java @@ -66,7 +66,7 @@ public class SalPortServiceImpl extends CommonService implements SalPortService @Override public void onFailure(final Throwable throwable) { - RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION, throwable.getMessage(), throwable); + RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION, throwable.getMessage(), throwable); RequestContextUtil.closeRequstContext(requestContext); getDeviceContext().unhookRequestCtx(requestContext.getXid()); getMessageSpy().spyMessage(portModInput.getImplementedInterface(), MessageSpy.STATISTIC_GROUP.TO_SWITCH_SUBMIT_FAILURE); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalTableServiceImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalTableServiceImpl.java index c794eef9a8..fb84225fef 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalTableServiceImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalTableServiceImpl.java @@ -118,7 +118,7 @@ public class SalTableServiceImpl extends CommonService implements SalTableServic @Override public void onFailure(final Throwable throwable) { - RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION, throwable.getMessage(), throwable); + RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION, throwable.getMessage(), throwable); RequestContextUtil.closeRequstContext(requestContext); getDeviceContext().unhookRequestCtx(requestContext.getXid()); getMessageSpy().spyMessage(multipartRequestInput.getImplementedInterface(), MessageSpy.STATISTIC_GROUP.TO_SWITCH_SUBMIT_FAILURE); @@ -136,7 +136,7 @@ public class SalTableServiceImpl extends CommonService implements SalTableServic private final Logger LOGGER = org.slf4j.LoggerFactory.getLogger(CallBackImpl.class); @Override - public void onSuccess(RpcResult> result) { + public void onSuccess(final RpcResult> result) { if (result.isSuccessful()) { final List multipartReplies = result.getResult(); @@ -162,7 +162,7 @@ public class SalTableServiceImpl extends CommonService implements SalTableServic } @Override - public void onFailure(Throwable t) { + public void onFailure(final Throwable t) { LOGGER.debug("Failure multipart response for table features request. Exception: {}", t); finalFuture.set(RpcResultBuilder.failed() .withError(ErrorType.RPC, "Future error", t).build()); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/dedicated/StatisticsGatheringService.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/dedicated/StatisticsGatheringService.java index 720a2dddb7..7a5685327c 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/dedicated/StatisticsGatheringService.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/dedicated/StatisticsGatheringService.java @@ -79,7 +79,7 @@ public class StatisticsGatheringService extends CommonService { @Override public void onFailure(final Throwable throwable) { - RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION, throwable.getMessage()); + RpcResultBuilder rpcResultBuilder = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION, throwable.getMessage()); getDeviceContext().unhookRequestCtx(requestContext.getXid()); RequestContextUtil.closeRequstContext(requestContext); -- 2.36.6