GameContext.log(1, "Warning: merging " + string + " into itself");
// its a self join
return;
}
GoBoardPositionSet stringMembers = new GoBoardPositionSet();
stringMembers.addAll(string.getMembers());
// must remove these after iterating otherwise we get a ConcurrentModificationException
string.getGroup().remove(string);
string.getMembers().clear();
Iterator it = stringMembers.iterator();
GoBoardPosition stone;
while ( it.hasNext() ) {
stone = (GoBoardPosition) it.next();
IGoString myString = stone.getString();
if (myString != null && myString != string) {
myString.remove(stone, board);
}
stone.setString(null);
addMemberInternal(stone, board);
}
stringMembers.clear();
libertyAnalyzer_.invalidate();
}