fix validation

This commit is contained in:
Mengyi Zhou 2016-03-08 19:55:24 +08:00
parent de81049b00
commit ff751b3a66

View file

@ -93,18 +93,16 @@ public class DefaultGroupValidator implements GroupValidator {
else
virtualServerIds.add(vs.getId());
}
if (groupPaths.contains(vs.getId() + vs.getVersion() + groupVirtualServer.getPath()))
if (groupPaths.contains(vs.getId() + groupVirtualServer.getPath()))
throw new ValidationException("Duplicate path \"" + groupVirtualServer.getPath() + "\" is found on virtual server " + vs.getId() + " from post entity.");
else
groupPaths.add(vs.getId() + vs.getVersion() + groupVirtualServer.getPath());
groupPaths.add(vs.getId() + groupVirtualServer.getPath());
}
for (RelGroupVsDo relGroupVsDo : rGroupVsDao.findAllByVses(virtualServerIds.toArray(new Long[virtualServerIds.size()]), RGroupVsEntity.READSET_FULL)) {
if (groupId.equals(relGroupVsDo.getGroupId()))
continue;
if (groupPaths.contains(relGroupVsDo.getVsId() + relGroupVsDo.getPath()))
throw new ValidationException("Duplicate path \"" + relGroupVsDo.getPath() + "\" is found on virtual server " + relGroupVsDo.getVsId() + " from existing entities.");
else
groupPaths.add(relGroupVsDo.getVsId() + relGroupVsDo.getPath());
}
}