Skip to content

Commit fd0afcb

Browse files
author
Sohit Chitray
committed
[ONOS-8034] ArrayList initialized inside loop
Arraylist is initialized again and again hence alreadyHandled deviceIds are lost Change-Id: I3d73084d199ae49440f0f25a205545150c7300b2
1 parent bfe5540 commit fd0afcb

File tree

1 file changed

+1
-1
lines changed
  • apps/cfm/app/src/main/java/org/onosproject/incubator/net/l2monitoring/cfm/impl

1 file changed

+1
-1
lines changed

apps/cfm/app/src/main/java/org/onosproject/incubator/net/l2monitoring/cfm/impl/CfmMepManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,14 @@ public boolean deleteMep(MdId mdName, MaIdShort maName, MepId mepId,
244244
//Iterate through all other devices and remove as a Remote Mep
245245
int mepsOnMdCount = 0;
246246
int mepsOnMaCount = 0;
247+
List<DeviceId> alreadyHandledDevices = new ArrayList<>();
247248
for (Mep mep : mepStore.getAllMeps()) {
248249
if (mep.deviceId().equals(mepDeviceId) && mdName.equals(mep.mdId())) {
249250
mepsOnMdCount++;
250251
if (maName.equals(mep.maId())) {
251252
mepsOnMaCount++;
252253
}
253254
}
254-
List<DeviceId> alreadyHandledDevices = new ArrayList<>();
255255
if (mep.deviceId().equals(mepDeviceId) || !mep.mdId().equals(mdName) ||
256256
!mep.maId().equals(maName) ||
257257
alreadyHandledDevices.contains(mep.deviceId())) {

0 commit comments

Comments
 (0)