REM:
1.解决java.util.ConcurrentModificationException: null报错
This commit is contained in:
chenlinghy 2021-01-21 17:09:56 +08:00
parent 8eb1b6fbcc
commit e782872b5b
1 changed files with 31 additions and 6 deletions

View File

@ -562,22 +562,47 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
}); });
// UMC 同步到处置平台 // UMC 同步到处置平台
dpBypassManager.getProtectObject().values().forEach(v -> { ArrayList<String> protectNames = new ArrayList<>();
String serviceId = v.getProtectName()
for (DpProtectObject value : dpBypassManager.getProtectObject().values()) {
protectNames.add(value.getProtectName());
}
for (String protectName : protectNames) {
String serviceId = protectName
.replace(objectPrefix + "_", "") .replace(objectPrefix + "_", "")
.replace("_" + IpAddrType.IPV4.getDescription(), "") .replace("_" + IpAddrType.IPV4.getDescription(), "")
.replace("_" + IpAddrType.IPV6.getDescription(), ""); .replace("_" + IpAddrType.IPV6.getDescription(), "");
// UMC上面存在对象已经失效 // UMC上面存在对象已经失效
if (disposeServiceGroup.values().stream().noneMatch(k -> serviceId.equals(k.getServiceId()))) { if (disposeServiceGroup.values().stream().noneMatch(k -> serviceId.equals(k.getServiceId()))) {
log.debug("++++Remove UMC Unused Protect Object: {}", v.getProtectName()); log.info("++++Remove UMC Unused Protect Object: {}", protectName);
ErrorCode err = removeProtectObject(v.getProtectName()); ErrorCode err = removeProtectObject(protectName);
if (err != ErrorCode.ERR_OK) { if (err != ErrorCode.ERR_OK) {
log.error("!!!!Remove Protect Object Error: {}", v.getProtectName()); log.error("!!!!Remove Protect Object Error: {}", protectName);
} }
} }
});
}
// dpBypassManager.getProtectObject().values().forEach(v -> {
// String serviceId = v.getProtectName()
// .replace(objectPrefix + "_", "")
// .replace("_" + IpAddrType.IPV4.getDescription(), "")
// .replace("_" + IpAddrType.IPV6.getDescription(), "");
//
// // UMC上面存在对象已经失效
// if (disposeServiceGroup.values().stream().noneMatch(k -> serviceId.equals(k.getServiceId()))) {
// log.info("++++Remove UMC Unused Protect Object: {}", v.getProtectName());
// ErrorCode err = removeProtectObject(v.getProtectName());
//
// if (err != ErrorCode.ERR_OK) {
// log.error("!!!!Remove Protect Object Error: {}", v.getProtectName());
// }
// }
// });
} }
/** /**