Source:
public List<String> resolveVirtualAttributeValueChange(PerunSessionImpl perunSession, String message) throws InternalErrorException, WrongReferenceAttributeValueException, AttributeNotExistsException, WrongAttributeAssignmentException { List<String> resolvingMessages = new ArrayList<>(); log.debug("Received message {}", message); if (message == null) return resolvingMessages; if (allAttributesRemovedForUserExtSource.matcher(message).find() || removeUserExtSourceAttribute.matcher(message).find() || setUserExtSourceAttribute.matcher(message).find()) { log.debug("Resolving virtual attribute value change for attribute " + this.getSourceAttributeFriendlyName() + " and message: " + message); User user = perunSession.getPerunBl().getModulesUtilsBl().getUserFromMessage(perunSession, message); if (user != null) { Attribute attribute = perunSession.getPerunBl().getAttributesManagerBl().getAttribute(perunSession, user, getDestinationAttributeName()); @SuppressWarnings("unchecked") List<String> attributeValue = (ArrayList<String>) attribute.getValue(); String messageAttributeSet; if (attributeValue == null || attributeValue.isEmpty()) { AttributeDefinition attributeDefinition = new AttributeDefinition(attribute); messageAttributeSet = attributeDefinition.serializeToString() + " removed for " + user.serializeToString() + "."; } else { messageAttributeSet = attribute.serializeToString() + " set for " + user.serializeToString() + "."; } resolvingMessages.add(messageAttributeSet); } if(!resolvingMessages.isEmpty()) log.debug("These new messages will be generated: " + resolvingMessages); } return resolvingMessages; }

Target:
public List<String> resolveVirtualAttributeValueChange(PerunSessionImpl perunSession, String message) throws InternalErrorException, WrongReferenceAttributeValueException, AttributeNotExistsException, WrongAttributeAssignmentException { List<String> resolvingMessages = new ArrayList<>(); if (message == null) return resolvingMessages; if (allAttributesRemovedForUserExtSource.matcher(message).find() || removeUserExtSourceAttribute.matcher(message).find() || setUserExtSourceAttribute.matcher(message).find()) { log.debug("Resolving virtual attribute value change for attribute " + this.getSourceAttributeFriendlyName() + " and message: " + message); User user = perunSession.getPerunBl().getModulesUtilsBl().getUserFromMessage(perunSession, message); if (user != null) { Attribute attribute = perunSession.getPerunBl().getAttributesManagerBl().getAttribute(perunSession, user, getDestinationAttributeName()); @SuppressWarnings("unchecked") List<String> attributeValue = (ArrayList<String>) attribute.getValue(); String messageAttributeSet; if (attributeValue == null || attributeValue.isEmpty()) { AttributeDefinition attributeDefinition = new AttributeDefinition(attribute); messageAttributeSet = attributeDefinition.serializeToString() + " removed for " + user.serializeToString() + "."; } else { messageAttributeSet = attribute.serializeToString() + " set for " + user.serializeToString() + "."; } resolvingMessages.add(messageAttributeSet); } if(!resolvingMessages.isEmpty()) log.debug("These new messages will be generated: " + resolvingMessages); } return resolvingMessages; }