Phaneendra Manda
Committed by Gerrit Code Review

Variable name changed for readability

Change-Id: Ie79aaacddd0c9a7885c55676ce69256603323ac8
...@@ -66,9 +66,9 @@ public class FlowsWebResource extends AbstractWebResource { ...@@ -66,9 +66,9 @@ public class FlowsWebResource extends AbstractWebResource {
66 public Response getFlows() { 66 public Response getFlows() {
67 final Iterable<Device> devices = get(DeviceService.class).getDevices(); 67 final Iterable<Device> devices = get(DeviceService.class).getDevices();
68 for (final Device device : devices) { 68 for (final Device device : devices) {
69 - final Iterable<FlowEntry> deviceEntries = service.getFlowEntries(device.id()); 69 + final Iterable<FlowEntry> flowEntries = service.getFlowEntries(device.id());
70 - if (deviceEntries != null) { 70 + if (flowEntries != null) {
71 - for (final FlowEntry entry : deviceEntries) { 71 + for (final FlowEntry entry : flowEntries) {
72 flowsNode.add(codec(FlowEntry.class).encode(entry, this)); 72 flowsNode.add(codec(FlowEntry.class).encode(entry, this));
73 } 73 }
74 } 74 }
...@@ -88,13 +88,13 @@ public class FlowsWebResource extends AbstractWebResource { ...@@ -88,13 +88,13 @@ public class FlowsWebResource extends AbstractWebResource {
88 @Produces(MediaType.APPLICATION_JSON) 88 @Produces(MediaType.APPLICATION_JSON)
89 @Path("{deviceId}") 89 @Path("{deviceId}")
90 public Response getFlowByDeviceId(@PathParam("deviceId") String deviceId) { 90 public Response getFlowByDeviceId(@PathParam("deviceId") String deviceId) {
91 - final Iterable<FlowEntry> deviceEntries = 91 + final Iterable<FlowEntry> flowEntries =
92 service.getFlowEntries(DeviceId.deviceId(deviceId)); 92 service.getFlowEntries(DeviceId.deviceId(deviceId));
93 93
94 - if (!deviceEntries.iterator().hasNext()) { 94 + if (!flowEntries.iterator().hasNext()) {
95 throw new ItemNotFoundException(DEVICE_NOT_FOUND); 95 throw new ItemNotFoundException(DEVICE_NOT_FOUND);
96 } 96 }
97 - for (final FlowEntry entry : deviceEntries) { 97 + for (final FlowEntry entry : flowEntries) {
98 flowsNode.add(codec(FlowEntry.class).encode(entry, this)); 98 flowsNode.add(codec(FlowEntry.class).encode(entry, this));
99 } 99 }
100 return ok(root).build(); 100 return ok(root).build();
...@@ -113,13 +113,13 @@ public class FlowsWebResource extends AbstractWebResource { ...@@ -113,13 +113,13 @@ public class FlowsWebResource extends AbstractWebResource {
113 @Path("{deviceId}/{flowId}") 113 @Path("{deviceId}/{flowId}")
114 public Response getFlowByDeviceIdAndFlowId(@PathParam("deviceId") String deviceId, 114 public Response getFlowByDeviceIdAndFlowId(@PathParam("deviceId") String deviceId,
115 @PathParam("flowId") long flowId) { 115 @PathParam("flowId") long flowId) {
116 - final Iterable<FlowEntry> deviceEntries = 116 + final Iterable<FlowEntry> flowEntries =
117 service.getFlowEntries(DeviceId.deviceId(deviceId)); 117 service.getFlowEntries(DeviceId.deviceId(deviceId));
118 118
119 - if (!deviceEntries.iterator().hasNext()) { 119 + if (!flowEntries.iterator().hasNext()) {
120 throw new ItemNotFoundException(DEVICE_NOT_FOUND); 120 throw new ItemNotFoundException(DEVICE_NOT_FOUND);
121 } 121 }
122 - for (final FlowEntry entry : deviceEntries) { 122 + for (final FlowEntry entry : flowEntries) {
123 if (entry.id().value() == flowId) { 123 if (entry.id().value() == flowId) {
124 flowsNode.add(codec(FlowEntry.class).encode(entry, this)); 124 flowsNode.add(codec(FlowEntry.class).encode(entry, this));
125 } 125 }
...@@ -175,14 +175,14 @@ public class FlowsWebResource extends AbstractWebResource { ...@@ -175,14 +175,14 @@ public class FlowsWebResource extends AbstractWebResource {
175 @Path("{deviceId}/{flowId}") 175 @Path("{deviceId}/{flowId}")
176 public void deleteFlowByDeviceIdAndFlowId(@PathParam("deviceId") String deviceId, 176 public void deleteFlowByDeviceIdAndFlowId(@PathParam("deviceId") String deviceId,
177 @PathParam("flowId") long flowId) { 177 @PathParam("flowId") long flowId) {
178 - final Iterable<FlowEntry> deviceEntries = 178 + final Iterable<FlowEntry> flowEntries =
179 service.getFlowEntries(DeviceId.deviceId(deviceId)); 179 service.getFlowEntries(DeviceId.deviceId(deviceId));
180 180
181 - if (!deviceEntries.iterator().hasNext()) { 181 + if (!flowEntries.iterator().hasNext()) {
182 throw new ItemNotFoundException(DEVICE_NOT_FOUND); 182 throw new ItemNotFoundException(DEVICE_NOT_FOUND);
183 } 183 }
184 184
185 - StreamSupport.stream(deviceEntries.spliterator(), false) 185 + StreamSupport.stream(flowEntries.spliterator(), false)
186 .filter(entry -> entry.id().value() == flowId) 186 .filter(entry -> entry.id().value() == flowId)
187 .forEach(service::removeFlowRules); 187 .forEach(service::removeFlowRules);
188 } 188 }
......