Source:
public 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); } } }

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); } } }