public void edit(final MultiLanguageString name, final Integer order) { if (name == null) { throw new NullPointerException(); }  setLastModifiedDateYearMonthDay(new YearMonthDay()); setName(name);  int newOrder = getNewOrder(order); if (getSectionOrder() == null) { setSectionOrder(Integer.valueOf(Integer.MAX_VALUE)); } if (getSectionOrder() != null) { final int oldOrder = getSectionOrder().intValue(); final boolean moveUp = newOrder > oldOrder; if (moveUp && order != null) { newOrder--; } if (newOrder != oldOrder) { final Collection<Section> sections = getSuperiorSection() == null ? getSite() .getAssociatedSectionsSet() : getSuperiorSection().getAssociatedSectionsSet(); for (final Section otherSection : sections) { if (otherSection.getSuperiorSection() == getSuperiorSection()) { if (this != otherSection) { final int otherOrder = otherSection.getSectionOrder().intValue(); if (moveUp) { if (otherOrder > oldOrder && otherOrder <= newOrder) { otherSection.setSectionOrder(Integer.valueOf(otherOrder - 1)); } } else { if (otherOrder >= newOrder && otherOrder < oldOrder) { otherSection.setSectionOrder(Integer.valueOf(otherOrder + 1)); } } } } } } }  setSectionOrder(Integer.valueOf(newOrder));
public void edit(MultiLanguageString name, Section nextSection, Group permittedGroup) { setLastModifiedDateYearMonthDay(new YearMonthDay());  setName(name); setNextSection(nextSection); setPermittedGroup(permittedGroup);
    public void edit(final MultiLanguageString name, final Integer order) {	if (name == null) {	    throw new NullPointerException();	}	setLastModifiedDateYearMonthDay(new YearMonthDay());	setName(name);	int newOrder = getNewOrder(order);	if (getSectionOrder() == null) {	    setSectionOrder(Integer.valueOf(Integer.MAX_VALUE));	}	if (getSectionOrder() != null) {	    final int oldOrder = getSectionOrder().intValue();	    final boolean moveUp = newOrder > oldOrder;	    if (moveUp && order != null) {		newOrder--;	    }	    if (newOrder != oldOrder) {		final Collection<Section> sections = getSuperiorSection() == null ? getSite()			.getAssociatedSectionsSet() : getSuperiorSection().getAssociatedSectionsSet();		for (final Section otherSection : sections) {		    if (otherSection.getSuperiorSection() == getSuperiorSection()) {			if (this != otherSection) {			    final int otherOrder = otherSection.getSectionOrder().intValue();			    if (moveUp) {				if (otherOrder > oldOrder && otherOrder <= newOrder) {				    otherSection.setSectionOrder(Integer.valueOf(otherOrder - 1));				}			    } else {				if (otherOrder >= newOrder && otherOrder < oldOrder) {				    otherSection.setSectionOrder(Integer.valueOf(otherOrder + 1));				}			    }			}		    }		}	    }	}	setSectionOrder(Integer.valueOf(newOrder));    }