Source:
<code>public void extendMembershipInGroup(PerunSession sess, Member member, Group group, boolean setValue) throws InternalErrorException, ExtendMembershipException { <START> Attribute membershipExpirationRulesAttribute = getMembershipExpirationRulesAttribute(sess, group); <END> if (membershipExpirationRulesAttribute == null) { return; } LinkedHashMap<String, String> membershipExpirationRules = (LinkedHashMap<String, String>) membershipExpirationRulesAttribute.getValue(); Calendar calendar = Calendar.getInstance(); Attribute membershipExpirationAttribute = getMemberExpiration(sess, member, group); checkLoaForExpiration(sess, membershipExpirationRules, membershipExpirationAttribute, member); String period = null; if (membershipExpirationRules.get(AbstractMembershipExpirationRulesModule.membershipPeriodKeyName) != null) { period = membershipExpirationRules.get(AbstractMembershipExpirationRulesModule.membershipPeriodKeyName); } String loaPeriod = getLoaPeriod(sess, member, membershipExpirationRules, membershipExpirationAttribute); if (loaPeriod != null) { period = loaPeriod; } if (period != null) { if (period.startsWith("+")) { extendForMonths(calendar, period, membershipExpirationRules, membershipExpirationAttribute, member, group); } else { extendForStaticDate(calendar, period, membershipExpirationRules, membershipExpirationAttribute, member, group); } } calendar.set(Calendar.HOUR, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); if (setValue) { membershipExpirationAttribute.setValue(BeansUtils.getDateFormatterWithoutTime().format(calendar.getTime())); try { getPerunBl().getAttributesManagerBl().setAttribute(sess, member, group, membershipExpirationAttribute); } catch (WrongAttributeValueException e) { throw new InternalErrorException("Wrong value: " + membershipExpirationAttribute.getValue(),e); } catch (WrongReferenceAttributeValueException | WrongAttributeAssignmentException | AttributeNotExistsException e) { throw new InternalErrorException(e); } } }</code><technical_language>methods this (in GroupsManagerBlImpl) similar methods for working members in VO. I prefer move Utils prevent duplicity of code possible</technical_language>

Target:
private void extendMembershipInGroup(PerunSession sess, Member member, Group group, boolean setValue) throws InternalErrorException, ExtendMembershipException { Attribute membershipExpirationRulesAttribute = getMembershipExpirationRulesAttribute(sess, group); if (membershipExpirationRulesAttribute == null) { return; } LinkedHashMap<String, String> membershipExpirationRules = (LinkedHashMap<String, String>) membershipExpirationRulesAttribute.getValue(); Calendar calendar = Calendar.getInstance(); Attribute membershipExpirationAttribute = getMemberExpiration(sess, member, group); checkLoaForExpiration(sess, membershipExpirationRules, membershipExpirationAttribute, member); String period = null; if (membershipExpirationRules.get(AbstractMembershipExpirationRulesModule.membershipPeriodKeyName) != null) { period = membershipExpirationRules.get(AbstractMembershipExpirationRulesModule.membershipPeriodKeyName); } String loaPeriod = getLoaPeriod(sess, member, membershipExpirationRules, membershipExpirationAttribute); if (loaPeriod != null) { period = loaPeriod; } if (period != null) { if (period.startsWith("+")) { extendForMonths(calendar, period, membershipExpirationRules, membershipExpirationAttribute, member, group); } else { extendForStaticDate(calendar, period, membershipExpirationRules, membershipExpirationAttribute, member, group); } } calendar.set(Calendar.HOUR, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); if (setValue) { membershipExpirationAttribute.setValue(BeansUtils.getDateFormatterWithoutTime().format(calendar.getTime())); try { getPerunBl().getAttributesManagerBl().setAttribute(sess, member, group, membershipExpirationAttribute); } catch (WrongAttributeValueException e) { throw new InternalErrorException("Wrong value: " + membershipExpirationAttribute.getValue(),e); } catch (WrongReferenceAttributeValueException | WrongAttributeAssignmentException | AttributeNotExistsException e) { throw new InternalErrorException(e); } } }