Use dianmond operator
Change-Id: I551dd9443b10ef17832f74a554486b7605e9866a
diff --git a/apps/vtnweb/src/main/java/org/onosproject/vtnweb/resources/SubnetWebResource.java b/apps/vtnweb/src/main/java/org/onosproject/vtnweb/resources/SubnetWebResource.java
index c46af6e..044397e 100644
--- a/apps/vtnweb/src/main/java/org/onosproject/vtnweb/resources/SubnetWebResource.java
+++ b/apps/vtnweb/src/main/java/org/onosproject/vtnweb/resources/SubnetWebResource.java
@@ -149,7 +149,7 @@
throws IOException {
try {
SubnetId subId = SubnetId.subnetId(id);
- Set<SubnetId> subIds = new HashSet<SubnetId>();
+ Set<SubnetId> subIds = new HashSet<>();
subIds.add(subId);
get(SubnetService.class).removeSubnets(subIds);
return Response.status(201).entity("SUCCESS").build();
@@ -183,7 +183,7 @@
*/
public Iterable<Subnet> changeJsonToSubs(JsonNode subnetNodes) {
checkNotNull(subnetNodes, JSON_NOT_NULL);
- Map<SubnetId, Subnet> subMap = new HashMap<SubnetId, Subnet>();
+ Map<SubnetId, Subnet> subMap = new HashMap<>();
for (JsonNode subnetNode : subnetNodes) {
if (!subnetNode.hasNonNull("id")) {
return null;
@@ -229,7 +229,7 @@
checkNotNull(subnetNodes, JSON_NOT_NULL);
checkArgument(subnetNodes.get("enable_dhcp").isBoolean(), "enable_dhcp should be boolean");
checkArgument(subnetNodes.get("shared").isBoolean(), "shared should be boolean");
- Map<SubnetId, Subnet> subMap = new HashMap<SubnetId, Subnet>();
+ Map<SubnetId, Subnet> subMap = new HashMap<>();
if (!subnetNodes.hasNonNull("id")) {
return null;
}
diff --git a/apps/vtnweb/src/main/java/org/onosproject/vtnweb/resources/TenantNetworkWebResource.java b/apps/vtnweb/src/main/java/org/onosproject/vtnweb/resources/TenantNetworkWebResource.java
index 9fd75ab..cd2ac29 100644
--- a/apps/vtnweb/src/main/java/org/onosproject/vtnweb/resources/TenantNetworkWebResource.java
+++ b/apps/vtnweb/src/main/java/org/onosproject/vtnweb/resources/TenantNetworkWebResource.java
@@ -240,7 +240,7 @@
@Path("{id}")
public Response deleteNetworks(@PathParam("id") String id) {
log.debug("Deletes network by identifier {}.", id);
- Set<TenantNetworkId> networkSet = new HashSet<TenantNetworkId>();
+ Set<TenantNetworkId> networkSet = new HashSet<>();
networkSet.add(TenantNetworkId.networkId(id));
Boolean issuccess = nullIsNotFound(get(TenantNetworkService.class)
.removeNetworks(networkSet), NETWORK_NOT_FOUND);
diff --git a/apps/vtnweb/src/main/java/org/onosproject/vtnweb/resources/VirtualPortWebResource.java b/apps/vtnweb/src/main/java/org/onosproject/vtnweb/resources/VirtualPortWebResource.java
index 0a427bb..1cb1444 100644
--- a/apps/vtnweb/src/main/java/org/onosproject/vtnweb/resources/VirtualPortWebResource.java
+++ b/apps/vtnweb/src/main/java/org/onosproject/vtnweb/resources/VirtualPortWebResource.java
@@ -131,7 +131,7 @@
@Path("{portUUID}")
@DELETE
public Response deletePorts(@PathParam("portUUID") String id) {
- Set<VirtualPortId> vPortIds = new HashSet<VirtualPortId>();
+ Set<VirtualPortId> vPortIds = new HashSet<>();
try {
if (id != null) {
vPortIds.add(VirtualPortId.portId(id));
@@ -201,8 +201,8 @@
*/
public Iterable<VirtualPort> changeJsonToPorts(JsonNode vPortNodes) {
checkNotNull(vPortNodes, JSON_NOT_NULL);
- Map<VirtualPortId, VirtualPort> portMap = new HashMap<VirtualPortId, VirtualPort>();
- Map<String, String> strMap = new HashMap<String, String>();
+ Map<VirtualPortId, VirtualPort> portMap = new HashMap<>();
+ Map<String, String> strMap = new HashMap<>();
for (JsonNode vPortnode : vPortNodes) {
VirtualPortId id = VirtualPortId.portId(vPortnode.get("id")
.asText());
@@ -220,7 +220,7 @@
.asText());
String deviceOwner = vPortnode.get("device_owner").asText();
JsonNode fixedIpNodes = vPortNodes.get("fixed_ips");
- Set<FixedIp> fixedIps = new HashSet<FixedIp>();
+ Set<FixedIp> fixedIps = new HashSet<>();
for (JsonNode fixedIpNode : fixedIpNodes) {
FixedIp fixedIp = jsonNodeToFixedIps(fixedIpNode);
fixedIps.add(fixedIp);
@@ -265,8 +265,8 @@
*/
public Iterable<VirtualPort> changeJsonToPort(JsonNode vPortNodes) {
checkNotNull(vPortNodes, JSON_NOT_NULL);
- Map<VirtualPortId, VirtualPort> vportMap = new HashMap<VirtualPortId, VirtualPort>();
- Map<String, String> strMap = new HashMap<String, String>();
+ Map<VirtualPortId, VirtualPort> vportMap = new HashMap<>();
+ Map<String, String> strMap = new HashMap<>();
VirtualPortId id = VirtualPortId.portId(vPortNodes.get("id").asText());
String name = vPortNodes.get("name").asText();
TenantId tenantId = TenantId.tenantId(vPortNodes.get("tenant_id")
@@ -281,7 +281,7 @@
.asText());
String deviceOwner = vPortNodes.get("device_owner").asText();
JsonNode fixedIpNodes = vPortNodes.get("fixed_ips");
- Set<FixedIp> fixedIps = new HashSet<FixedIp>();
+ Set<FixedIp> fixedIps = new HashSet<>();
for (JsonNode fixedIpNode : fixedIpNodes) {
FixedIp fixedIp = jsonNodeToFixedIps(fixedIpNode);
fixedIps.add(fixedIp);