public void deleteGroup(String key, IPerson deleter) {
if (!canDeleteGroup(deleter, key)) {
throw new RuntimeAuthorizationException(deleter, IPermission.DELETE_GROUP_ACTIVITY, key);
}
log.info("Deleting group with key " + key);
<BUG>IEntityGroup group = GroupService.findGroup(key);
Iterator<IEntityGroup> iter = group.getParentGroups().iterator();
while (iter.hasNext()) {
IEntityGroup parent = (IEntityGroup) iter.next();</BUG>
parent.removeChild(group);

public void deleteGroup(String key, IPerson deleter) {
if (!canDeleteGroup(deleter, key)) {
throw new RuntimeAuthorizationException(deleter, IPermission.DELETE_GROUP_ACTIVITY, key);
}
log.info("Deleting group with key " + key);
IEntityGroup group = GroupService.findGroup(key);
for (IEntityGroup parent : group.getParentGroups()) {
parent.removeChild(group);
