private void enforceNestability(LinkedPositionGroup group) throws BadLocationException {  Assert.isTrue(fParentEnvironment == null || fParentEnvironment.fGroups.size() > 0); if (fParentEnvironment == null) return;  for (Iterator it= fParentEnvironment.fGroups.iterator(); it.hasNext(); ) { LinkedPositionGroup pg= (LinkedPositionGroup) it.next(); LinkedPosition pos= pg.adopt(group); if (pos != null && fParentPosition != null && fParentPosition != pos) throw new BadLocationException(); else if (fParentPosition == null && pos != null) fParentPosition= pos;
private boolean enforceNestability(LinkedPositionGroup group, LinkedEnvironment environment) { Assert.isNotNull(environment); Assert.isNotNull(group);  try { for (Iterator it= environment.fGroups.iterator(); it.hasNext(); ) { LinkedPositionGroup pg= (LinkedPositionGroup) it.next(); LinkedPosition pos; pos= pg.adopt(group); if (pos != null && fParentPosition != null && fParentPosition != pos) return false; else if (fParentPosition == null && pos != null) fParentPosition= pos; } } catch (BadLocationException e) { return false;
	private void enforceNestability(LinkedPositionGroup group) throws BadLocationException {		// TODO debug trace the erroneous nestings.		Assert.isTrue(fParentEnvironment == null || fParentEnvironment.fGroups.size() > 0);		if (fParentEnvironment == null)			return;		for (Iterator it= fParentEnvironment.fGroups.iterator(); it.hasNext(); ) {			LinkedPositionGroup pg= (LinkedPositionGroup) it.next();			LinkedPosition pos= pg.adopt(group);			if (pos != null && fParentPosition != null && fParentPosition != pos)				throw new BadLocationException();			else if (fParentPosition == null && pos != null)				fParentPosition= pos;		}		// group must fit in exactly one of the parent's positions		if (fParentPosition == null)			throw new BadLocationException();	}