Simon Hunt
Committed by Gerrit Code Review

Removed unnecessary mapper declaration -- use the one exposed in the superclass.

Change-Id: I90154dddb6dd69a064097a93a9c3cabec251c599
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
15 */ 15 */
16 package org.onosproject.ui.impl; 16 package org.onosproject.ui.impl;
17 17
18 -import com.fasterxml.jackson.databind.ObjectMapper;
19 import com.fasterxml.jackson.databind.node.ArrayNode; 18 import com.fasterxml.jackson.databind.node.ArrayNode;
20 import com.fasterxml.jackson.databind.node.ObjectNode; 19 import com.fasterxml.jackson.databind.node.ObjectNode;
21 import com.google.common.collect.ImmutableSet; 20 import com.google.common.collect.ImmutableSet;
...@@ -60,8 +59,6 @@ public class DeviceViewMessageHandler extends AbstractTabularViewMessageHandler ...@@ -60,8 +59,6 @@ public class DeviceViewMessageHandler extends AbstractTabularViewMessageHandler
60 private static final String SPEED = "speed"; 59 private static final String SPEED = "speed";
61 private static final String NAME = "name"; 60 private static final String NAME = "name";
62 61
63 - private static final ObjectMapper MAPPER = new ObjectMapper();
64 -
65 62
66 /** 63 /**
67 * Creates a new message handler for the device messages. 64 * Creates a new message handler for the device messages.
...@@ -107,7 +104,7 @@ public class DeviceViewMessageHandler extends AbstractTabularViewMessageHandler ...@@ -107,7 +104,7 @@ public class DeviceViewMessageHandler extends AbstractTabularViewMessageHandler
107 DeviceService service = get(DeviceService.class); 104 DeviceService service = get(DeviceService.class);
108 MastershipService ms = get(MastershipService.class); 105 MastershipService ms = get(MastershipService.class);
109 Device device = service.getDevice(deviceId); 106 Device device = service.getDevice(deviceId);
110 - ObjectNode data = MAPPER.createObjectNode(); 107 + ObjectNode data = mapper.createObjectNode();
111 108
112 data.put(ID, deviceId.toString()); 109 data.put(ID, deviceId.toString());
113 data.put(TYPE, device.type().toString()); 110 data.put(TYPE, device.type().toString());
...@@ -120,7 +117,7 @@ public class DeviceViewMessageHandler extends AbstractTabularViewMessageHandler ...@@ -120,7 +117,7 @@ public class DeviceViewMessageHandler extends AbstractTabularViewMessageHandler
120 data.put(MASTER_ID, ms.getMasterFor(deviceId).toString()); 117 data.put(MASTER_ID, ms.getMasterFor(deviceId).toString());
121 data.put(PROTOCOL, device.annotations().value(PROTOCOL)); 118 data.put(PROTOCOL, device.annotations().value(PROTOCOL));
122 119
123 - ArrayNode ports = MAPPER.createArrayNode(); 120 + ArrayNode ports = mapper.createArrayNode();
124 121
125 List<Port> portList = new ArrayList<>(service.getPorts(deviceId)); 122 List<Port> portList = new ArrayList<>(service.getPorts(deviceId));
126 Collections.sort(portList, (p1, p2) -> { 123 Collections.sort(portList, (p1, p2) -> {
...@@ -150,7 +147,7 @@ public class DeviceViewMessageHandler extends AbstractTabularViewMessageHandler ...@@ -150,7 +147,7 @@ public class DeviceViewMessageHandler extends AbstractTabularViewMessageHandler
150 } 147 }
151 148
152 private ObjectNode portData(Port p, DeviceId id) { 149 private ObjectNode portData(Port p, DeviceId id) {
153 - ObjectNode port = MAPPER.createObjectNode(); 150 + ObjectNode port = mapper.createObjectNode();
154 LinkService ls = get(LinkService.class); 151 LinkService ls = get(LinkService.class);
155 String name = p.annotations().value(AnnotationKeys.PORT_NAME); 152 String name = p.annotations().value(AnnotationKeys.PORT_NAME);
156 153
......