Fix issues found by FindBugs: URF_UNREAD_FIELD
http://findbugs.sourceforge.net/bugDescriptions.html#URF_UNREAD_FIELD
Change-Id: I5299f1750134927598fa191972167b07b40b0d11
diff --git a/src/main/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModule.java b/src/main/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModule.java
index 3e3af13..4ba9b54 100755
--- a/src/main/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModule.java
+++ b/src/main/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModule.java
@@ -155,7 +155,7 @@
opEventChannel = datagridService.createChannel(INTENT_OP_EVENT_CHANNEL_NAME, Long.class, IntentOperationList.class);
datagridService.addListener(INTENT_STATE_EVENT_CHANNEL_NAME, this, Long.class, IntentStateList.class);
networkGraphService.registerNetworkGraphListener(this);
- persistIntent = new PersistIntent(controllerRegistry, networkGraphService);
+ persistIntent = new PersistIntent(controllerRegistry);
}
// ================================================================================
diff --git a/src/main/java/net/onrc/onos/core/intent/runtime/PersistIntent.java b/src/main/java/net/onrc/onos/core/intent/runtime/PersistIntent.java
index 737aeae..e2b2917 100755
--- a/src/main/java/net/onrc/onos/core/intent/runtime/PersistIntent.java
+++ b/src/main/java/net/onrc/onos/core/intent/runtime/PersistIntent.java
@@ -17,8 +17,6 @@
import net.onrc.onos.core.intent.IntentOperationList;
import net.onrc.onos.core.registry.IControllerRegistryService;
import net.onrc.onos.core.registry.IdBlock;
-import net.onrc.onos.core.topology.INetworkGraphService;
-import net.onrc.onos.core.topology.NetworkGraph;
import net.onrc.onos.core.util.serializers.KryoFactory;
import org.slf4j.Logger;
@@ -34,7 +32,6 @@
private static final Logger log = LoggerFactory.getLogger(IntentResource.class);
private long range = 10000L;
private final IControllerRegistryService controllerRegistry;
- NetworkGraph graph = null;
private static final String INTENT_JOURNAL = "G:IntentJournal";
private static final int VALUE_STORE_LIMIT = 1024 * 1024;
private IKVTable table;
@@ -46,9 +43,8 @@
private IdBlock idBlock = null;
- public PersistIntent(final IControllerRegistryService controllerRegistry, INetworkGraphService ng) {
+ public PersistIntent(final IControllerRegistryService controllerRegistry) {
this.controllerRegistry = controllerRegistry;
- this.graph = ng.getNetworkGraph();
table = DataStoreClient.getClient().getTable(INTENT_JOURNAL);
stream = new ByteArrayOutputStream(1024);
output = new Output(stream);
diff --git a/src/main/java/net/onrc/onos/core/registry/ZookeeperRegistry.java b/src/main/java/net/onrc/onos/core/registry/ZookeeperRegistry.java
index 464dd01..504e661 100755
--- a/src/main/java/net/onrc/onos/core/registry/ZookeeperRegistry.java
+++ b/src/main/java/net/onrc/onos/core/registry/ZookeeperRegistry.java
@@ -139,11 +139,9 @@
protected class SwitchLeaderListener implements LeaderLatchListener {
String dpid;
- LeaderLatch latch;
- public SwitchLeaderListener(String dpid, LeaderLatch latch) {
+ public SwitchLeaderListener(String dpid) {
this.dpid = dpid;
- this.latch = latch;
}
@Override
@@ -205,10 +203,7 @@
}
protected static class ClusterLeaderListener implements LeaderLatchListener {
- LeaderLatch latch;
-
- public ClusterLeaderListener(LeaderLatch latch) {
- this.latch = latch;
+ public ClusterLeaderListener() {
}
//
@@ -254,7 +249,7 @@
}
LeaderLatch latch = new LeaderLatch(client, latchPath, controllerId);
- SwitchLeaderListener listener = new SwitchLeaderListener(dpidStr, latch);
+ SwitchLeaderListener listener = new SwitchLeaderListener(dpidStr);
latch.addListener(listener);
@@ -626,7 +621,7 @@
clusterLeaderLatch = new LeaderLatch(client,
CLUSTER_LEADER_PATH,
controllerId);
- clusterLeaderListener = new ClusterLeaderListener(clusterLeaderLatch);
+ clusterLeaderListener = new ClusterLeaderListener();
clusterLeaderLatch.addListener(clusterLeaderListener);
try {
clusterLeaderLatch.start();
diff --git a/src/test/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModuleTest.java b/src/test/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModuleTest.java
index 93f01ca..421d2fa 100644
--- a/src/test/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModuleTest.java
+++ b/src/test/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModuleTest.java
@@ -85,8 +85,7 @@
persistIntent = PowerMock.createMock(PersistIntent.class);
PowerMock.expectNew(PersistIntent.class,
- anyObject(IControllerRegistryService.class),
- anyObject(INetworkGraphService.class)).andReturn(persistIntent);
+ anyObject(IControllerRegistryService.class)).andReturn(persistIntent);
expect(modContext.getServiceImpl(IDatagridService.class))
.andReturn(datagridService).once();
diff --git a/src/test/java/net/onrc/onos/core/intent/runtime/UseCaseTest.java b/src/test/java/net/onrc/onos/core/intent/runtime/UseCaseTest.java
index fbb7313..0e58739 100755
--- a/src/test/java/net/onrc/onos/core/intent/runtime/UseCaseTest.java
+++ b/src/test/java/net/onrc/onos/core/intent/runtime/UseCaseTest.java
@@ -76,8 +76,7 @@
persistIntent = PowerMock.createMock(PersistIntent.class);
PowerMock.expectNew(PersistIntent.class,
- anyObject(IControllerRegistryService.class),
- anyObject(INetworkGraphService.class)).andReturn(persistIntent);
+ anyObject(IControllerRegistryService.class)).andReturn(persistIntent);
expect(modContext.getServiceImpl(IDatagridService.class))
.andReturn(datagridService).once();