Use dianmond operator
Change-Id: I551dd9443b10ef17832f74a554486b7605e9866a
diff --git a/apps/acl/src/main/java/org/onos/acl/impl/DistributedAclStore.java b/apps/acl/src/main/java/org/onos/acl/impl/DistributedAclStore.java
index 6d909a9..5c8a93c 100644
--- a/apps/acl/src/main/java/org/onos/acl/impl/DistributedAclStore.java
+++ b/apps/acl/src/main/java/org/onos/acl/impl/DistributedAclStore.java
@@ -234,7 +234,7 @@
ruleToDevice.computeIf(ruleId,
deviceIdSet -> (deviceIdSet == null || !deviceIdSet.contains(deviceId)),
(id, deviceIdSet) -> {
- Set<DeviceId> newSet = new HashSet<DeviceId>();
+ Set<DeviceId> newSet = new HashSet<>();
if (deviceIdSet != null) {
newSet.addAll(deviceIdSet);
}
@@ -248,4 +248,4 @@
ruleToDevice.remove(ruleId);
}
-}
\ No newline at end of file
+}
diff --git a/apps/optical/src/main/java/org/onosproject/optical/cfg/OpticalNetworkConfig.java b/apps/optical/src/main/java/org/onosproject/optical/cfg/OpticalNetworkConfig.java
index f3f8d17..2ef5cd5 100644
--- a/apps/optical/src/main/java/org/onosproject/optical/cfg/OpticalNetworkConfig.java
+++ b/apps/optical/src/main/java/org/onosproject/optical/cfg/OpticalNetworkConfig.java
@@ -34,8 +34,8 @@
private List<OpticalLinkDescription> opticalLinks;
public OpticalNetworkConfig() {
- opticalSwitches = new ArrayList<OpticalSwitchDescription>();
- opticalLinks = new ArrayList<OpticalLinkDescription>();
+ opticalSwitches = new ArrayList<>();
+ opticalLinks = new ArrayList<>();
}
public List<OpticalSwitchDescription> getOpticalSwitches() {
diff --git a/apps/sdnip/src/main/java/org/onosproject/sdnip/IntentSynchronizer.java b/apps/sdnip/src/main/java/org/onosproject/sdnip/IntentSynchronizer.java
index 35ff705..d8d8f45 100644
--- a/apps/sdnip/src/main/java/org/onosproject/sdnip/IntentSynchronizer.java
+++ b/apps/sdnip/src/main/java/org/onosproject/sdnip/IntentSynchronizer.java
@@ -887,7 +887,7 @@
checkNotNull(dstMacAddress);
checkNotNull(srcConnectPoint);
- Set<ConnectPoint> ingressPoints = new HashSet<ConnectPoint>();
+ Set<ConnectPoint> ingressPoints = new HashSet<>();
ingressPoints.add(srcConnectPoint);
IpPrefix dstIpPrefix = dstIpAddress.toIpPrefix();
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DeviceConfiguration.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DeviceConfiguration.java
index e18ebfa..9a6e127 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DeviceConfiguration.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DeviceConfiguration.java
@@ -48,7 +48,7 @@
private static final Logger log = LoggerFactory
.getLogger(DeviceConfiguration.class);
- private final List<Integer> allSegmentIds = new ArrayList<Integer>();
+ private final List<Integer> allSegmentIds = new ArrayList<>();
private final HashMap<DeviceId, SegmentRouterInfo> deviceConfigMap = new HashMap<>();
private final NetworkConfigManager configService;
@@ -88,7 +88,7 @@
info.ip = prefix.address();
info.isEdge = ((SegmentRouterConfig) cfg).isEdgeRouter();
info.subnets = new HashMap<>();
- info.gatewayIps = new HashMap<PortNumber, Ip4Address>();
+ info.gatewayIps = new HashMap<>();
for (Subnet s: ((SegmentRouterConfig) cfg).getSubnets()) {
info.subnets.put(PortNumber.portNumber(s.getPortNo()),
Ip4Prefix.valueOf(s.getSubnetIp()));
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/ECMPShortestPathGraph.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/ECMPShortestPathGraph.java
index cd28fcf..b483d9e 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/ECMPShortestPathGraph.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/ECMPShortestPathGraph.java
@@ -109,7 +109,7 @@
ArrayList<DeviceId> distanceSwArray = distanceDeviceMap
.get(currDistance + 1);
if (distanceSwArray == null) {
- distanceSwArray = new ArrayList<DeviceId>();
+ distanceSwArray = new ArrayList<>();
distanceSwArray.add(reachedDevice);
distanceDeviceMap.put(currDistance + 1, distanceSwArray);
} else {
@@ -120,7 +120,7 @@
ArrayList<Link> upstreamLinkArray =
upstreamLinks.get(reachedDevice);
if (upstreamLinkArray == null) {
- upstreamLinkArray = new ArrayList<Link>();
+ upstreamLinkArray = new ArrayList<>();
upstreamLinkArray.add(copyDefaultLink(link));
//upstreamLinkArray.add(link);
upstreamLinks.put(reachedDevice, upstreamLinkArray);
@@ -183,7 +183,7 @@
ArrayList<DeviceId> distanceSwArray = distanceDeviceMap
.get(currDistance + 1);
if (distanceSwArray == null) {
- distanceSwArray = new ArrayList<DeviceId>();
+ distanceSwArray = new ArrayList<>();
distanceSwArray.add(reachedDevice);
distanceDeviceMap.put(currDistance + 1, distanceSwArray);
} else {
@@ -194,7 +194,7 @@
ArrayList<Link> upstreamLinkArray =
upstreamLinks.get(reachedDevice);
if (upstreamLinkArray == null) {
- upstreamLinkArray = new ArrayList<Link>();
+ upstreamLinkArray = new ArrayList<>();
upstreamLinkArray.add(copyDefaultLink(link));
upstreamLinks.put(reachedDevice, upstreamLinkArray);
} else {
@@ -234,7 +234,7 @@
for (Link upstreamLink : upstreamLinks.get(dstDeviceDeviceId)) {
/* Deep clone the path object */
Path sofarPath;
- ArrayList<Link> sofarLinks = new ArrayList<Link>();
+ ArrayList<Link> sofarLinks = new ArrayList<>();
if (path != null && !path.links().isEmpty()) {
sofarLinks.addAll(path.links());
}
@@ -288,12 +288,10 @@
public HashMap<Integer, HashMap<DeviceId,
ArrayList<Path>>> getCompleteLearnedDeviceesAndPaths() {
- HashMap<Integer, HashMap<DeviceId, ArrayList<Path>>> pathGraph = new
- HashMap<Integer, HashMap<DeviceId, ArrayList<Path>>>();
+ HashMap<Integer, HashMap<DeviceId, ArrayList<Path>>> pathGraph = new HashMap<>();
for (Integer itrIndx : distanceDeviceMap.keySet()) {
- HashMap<DeviceId, ArrayList<Path>> swMap = new
- HashMap<DeviceId, ArrayList<Path>>();
+ HashMap<DeviceId, ArrayList<Path>> swMap = new HashMap<>();
for (DeviceId sw : distanceDeviceMap.get(itrIndx)) {
swMap.put(sw, getECMPPaths(sw));
}
@@ -314,12 +312,10 @@
public HashMap<Integer, HashMap<DeviceId,
ArrayList<ArrayList<DeviceId>>>> getAllLearnedSwitchesAndVia() {
- HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>> deviceViaMap =
- new HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>>();
+ HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>> deviceViaMap = new HashMap<>();
for (Integer itrIndx : distanceDeviceMap.keySet()) {
- HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>> swMap =
- new HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>();
+ HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>> swMap = new HashMap<>();
for (DeviceId sw : distanceDeviceMap.get(itrIndx)) {
ArrayList<ArrayList<DeviceId>> swViaArray = new ArrayList<>();
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/IpHandler.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/IpHandler.java
index 81d00f5..e37fe52 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/IpHandler.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/IpHandler.java
@@ -50,7 +50,7 @@
public IpHandler(SegmentRoutingManager srManager) {
this.srManager = srManager;
this.config = checkNotNull(srManager.deviceConfiguration);
- ipPacketQueue = new ConcurrentHashMap<Ip4Address, ConcurrentLinkedQueue<IPv4>>();
+ ipPacketQueue = new ConcurrentHashMap<>();
}
/**
@@ -104,7 +104,7 @@
Ip4Address destIpAddress = Ip4Address.valueOf(ipPacket.getDestinationAddress());
if (ipPacketQueue.get(destIpAddress) == null) {
- ConcurrentLinkedQueue<IPv4> queue = new ConcurrentLinkedQueue<IPv4>();
+ ConcurrentLinkedQueue<IPv4> queue = new ConcurrentLinkedQueue<>();
queue.add(ipPacket);
ipPacketQueue.put(destIpAddress, queue);
} else {
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/RoutingRulePopulator.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/RoutingRulePopulator.java
index 59fc4ca..d802be9 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/RoutingRulePopulator.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/RoutingRulePopulator.java
@@ -221,7 +221,7 @@
Set<DeviceId> nextHops) {
TrafficSelector.Builder sbuilder = DefaultTrafficSelector.builder();
- List<ForwardingObjective.Builder> fwdObjBuilders = new ArrayList<ForwardingObjective.Builder>();
+ List<ForwardingObjective.Builder> fwdObjBuilders = new ArrayList<>();
// TODO Handle the case of Bos == false
sbuilder.matchMplsLabel(MplsLabel.mplsLabel(config.getSegmentId(destSwId)));
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultEdgeGroupHandler.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultEdgeGroupHandler.java
index 41cf8ac..3dc312d 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultEdgeGroupHandler.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultEdgeGroupHandler.java
@@ -69,7 +69,7 @@
Set<Set<DeviceId>> powerSet = getPowerSetOfNeighbors(neighbors);
log.trace("createGroupsAtEdgeRouter: The size of neighbor powerset "
+ "for sw {} is {}", deviceId, powerSet.size());
- Set<NeighborSet> nsSet = new HashSet<NeighborSet>();
+ Set<NeighborSet> nsSet = new HashSet<>();
for (Set<DeviceId> combo : powerSet) {
if (combo.isEmpty()) {
continue;
@@ -148,7 +148,7 @@
Set<DeviceId> updatedNeighbors) {
Set<Set<DeviceId>> powerSet = getPowerSetOfNeighbors(updatedNeighbors);
- Set<DeviceId> tmp = new HashSet<DeviceId>();
+ Set<DeviceId> tmp = new HashSet<>();
tmp.addAll(updatedNeighbors);
tmp.remove(impactedNeighbor);
Set<Set<DeviceId>> tmpPowerSet = getPowerSetOfNeighbors(tmp);
@@ -156,7 +156,7 @@
// Compute the impacted neighbor sets
powerSet.removeAll(tmpPowerSet);
- Set<NeighborSet> nsSet = new HashSet<NeighborSet>();
+ Set<NeighborSet> nsSet = new HashSet<>();
for (Set<DeviceId> combo : powerSet) {
if (combo.isEmpty()) {
continue;
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java
index a43a0f0..3ff0e35 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java
@@ -371,7 +371,7 @@
if (devicePortMap.get(neighborId) != null) {
devicePortMap.get(neighborId).add(portToNeighbor);
} else {
- Set<PortNumber> ports = new HashSet<PortNumber>();
+ Set<PortNumber> ports = new HashSet<>();
ports.add(portToNeighbor);
devicePortMap.put(neighborId, ports);
}
@@ -383,8 +383,8 @@
}
protected Set<Set<DeviceId>> getPowerSetOfNeighbors(Set<DeviceId> neighbors) {
- List<DeviceId> list = new ArrayList<DeviceId>(neighbors);
- Set<Set<DeviceId>> sets = new HashSet<Set<DeviceId>>();
+ List<DeviceId> list = new ArrayList<>(neighbors);
+ Set<Set<DeviceId>> sets = new HashSet<>();
// get the number of elements in the neighbors
int elements = list.size();
// the number of members of a power set is 2^n
@@ -394,7 +394,7 @@
// run a binary counter for the number of power elements
// NOTE: Exclude empty set
for (long i = 1; i < powerElements; i++) {
- Set<DeviceId> neighborSubSet = new HashSet<DeviceId>();
+ Set<DeviceId> neighborSubSet = new HashSet<>();
for (int j = 0; j < elements; j++) {
if ((i >> j) % 2 == 1) {
neighborSubSet.add(list.get(j));
@@ -411,7 +411,7 @@
protected List<Integer> getSegmentIdsTobePairedWithNeighborSet(Set<DeviceId> neighbors) {
- List<Integer> nsSegmentIds = new ArrayList<Integer>();
+ List<Integer> nsSegmentIds = new ArrayList<>();
// Always pair up with no edge label
// If (neighbors.size() == 1) {
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultTransitGroupHandler.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultTransitGroupHandler.java
index e12426c..3cb73ab 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultTransitGroupHandler.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultTransitGroupHandler.java
@@ -63,7 +63,7 @@
sets = filterEdgeRouterOnlyPairings(sets);
log.debug("createGroupsAtTransitRouter: The size of neighbor powerset "
+ "for sw {} is {}", deviceId, sets.size());
- Set<NeighborSet> nsSet = new HashSet<NeighborSet>();
+ Set<NeighborSet> nsSet = new HashSet<>();
for (Set<DeviceId> combo : sets) {
if (combo.isEmpty()) {
continue;
@@ -137,7 +137,7 @@
Set<DeviceId> updatedNeighbors) {
Set<Set<DeviceId>> powerSet = getPowerSetOfNeighbors(updatedNeighbors);
- Set<DeviceId> tmp = new HashSet<DeviceId>();
+ Set<DeviceId> tmp = new HashSet<>();
tmp.addAll(updatedNeighbors);
tmp.remove(impactedNeighbor);
Set<Set<DeviceId>> tmpPowerSet = getPowerSetOfNeighbors(tmp);
@@ -146,7 +146,7 @@
powerSet.removeAll(tmpPowerSet);
powerSet = filterEdgeRouterOnlyPairings(powerSet);
- Set<NeighborSet> nsSet = new HashSet<NeighborSet>();
+ Set<NeighborSet> nsSet = new HashSet<>();
for (Set<DeviceId> combo : powerSet) {
if (combo.isEmpty()) {
continue;
@@ -163,7 +163,7 @@
}
private Set<Set<DeviceId>> filterEdgeRouterOnlyPairings(Set<Set<DeviceId>> sets) {
- Set<Set<DeviceId>> fiteredSets = new HashSet<Set<DeviceId>>();
+ Set<Set<DeviceId>> fiteredSets = new HashSet<>();
for (Set<DeviceId> deviceSubSet : sets) {
if (deviceSubSet.size() > 1) {
boolean avoidEdgeRouterPairing = true;
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/NeighborSet.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/NeighborSet.java
index 7ada322..44715d2 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/NeighborSet.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/NeighborSet.java
@@ -44,7 +44,7 @@
public NeighborSet(Set<DeviceId> neighbors) {
checkNotNull(neighbors);
this.edgeLabel = NO_EDGE_LABEL;
- this.neighbors = new HashSet<DeviceId>();
+ this.neighbors = new HashSet<>();
this.neighbors.addAll(neighbors);
}
@@ -57,7 +57,7 @@
public NeighborSet(Set<DeviceId> neighbors, int edgeLabel) {
checkNotNull(neighbors);
this.edgeLabel = edgeLabel;
- this.neighbors = new HashSet<DeviceId>();
+ this.neighbors = new HashSet<>();
this.neighbors.addAll(neighbors);
}
@@ -66,7 +66,7 @@
*/
public NeighborSet() {
this.edgeLabel = NO_EDGE_LABEL;
- this.neighbors = new HashSet<DeviceId>();
+ this.neighbors = new HashSet<>();
}
/**
diff --git a/apps/test/distributed-primitives/src/main/java/org/onosproject/distributedprimitives/cli/SetTestAddCommand.java b/apps/test/distributed-primitives/src/main/java/org/onosproject/distributedprimitives/cli/SetTestAddCommand.java
index 0ccc2d3..204471c 100644
--- a/apps/test/distributed-primitives/src/main/java/org/onosproject/distributedprimitives/cli/SetTestAddCommand.java
+++ b/apps/test/distributed-primitives/src/main/java/org/onosproject/distributedprimitives/cli/SetTestAddCommand.java
@@ -44,7 +44,7 @@
String[] values = null;
Set<String> set;
- Set<String> toAdd = new HashSet<String>();
+ Set<String> toAdd = new HashSet<>();
Serializer serializer = Serializer.using(
diff --git a/apps/test/distributed-primitives/src/main/java/org/onosproject/distributedprimitives/cli/SetTestGetCommand.java b/apps/test/distributed-primitives/src/main/java/org/onosproject/distributedprimitives/cli/SetTestGetCommand.java
index 0877e6f..fb36a06 100644
--- a/apps/test/distributed-primitives/src/main/java/org/onosproject/distributedprimitives/cli/SetTestGetCommand.java
+++ b/apps/test/distributed-primitives/src/main/java/org/onosproject/distributedprimitives/cli/SetTestGetCommand.java
@@ -49,7 +49,7 @@
String[] values = null;
Set<String> set;
- Set<String> toCheck = new HashSet<String>();
+ Set<String> toCheck = new HashSet<>();
String output = "";
Serializer serializer = Serializer.using(
diff --git a/apps/test/distributed-primitives/src/main/java/org/onosproject/distributedprimitives/cli/SetTestRemoveCommand.java b/apps/test/distributed-primitives/src/main/java/org/onosproject/distributedprimitives/cli/SetTestRemoveCommand.java
index 7e3a3e8..d1f81e4 100644
--- a/apps/test/distributed-primitives/src/main/java/org/onosproject/distributedprimitives/cli/SetTestRemoveCommand.java
+++ b/apps/test/distributed-primitives/src/main/java/org/onosproject/distributedprimitives/cli/SetTestRemoveCommand.java
@@ -54,7 +54,7 @@
String[] values = null;
Set<String> set;
- Set<String> givenValues = new HashSet<String>();
+ Set<String> givenValues = new HashSet<>();
Serializer serializer = Serializer.using(
new KryoNamespace.Builder().register(KryoNamespaces.BASIC).build());
diff --git a/apps/vtn/src/main/java/org/onosproject/vtn/impl/VTNManager.java b/apps/vtn/src/main/java/org/onosproject/vtn/impl/VTNManager.java
index 01c9882..f7d2886 100644
--- a/apps/vtn/src/main/java/org/onosproject/vtn/impl/VTNManager.java
+++ b/apps/vtn/src/main/java/org/onosproject/vtn/impl/VTNManager.java
@@ -626,7 +626,7 @@
VirtualPort port = virtualPortService.getPort(portId);
TenantNetwork network = tenantNetworkService
.getNetwork(port.networkId());
- Collection<String> ifaceIds = new HashSet<String>();
+ Collection<String> ifaceIds = new HashSet<>();
Collection<VirtualPort> ports = virtualPortService
.getPorts(network.id());
Sets.newHashSet(ports).stream()
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);