Source:
<code>public void setUserExtSourceAttributes(PerunSession session, UserExtSource ues, Map<String, String> additionalAttributes) throws InternalErrorException { List<AttributeDefinition> attrs = coreConfig.getAttributesForUpdate().get(ues.getExtSource().getType()); if (attrs != null) { for (AttributeDefinition attr : attrs) { String attrValue = additionalAttributes.get(attr.getFriendlyName()); if ("".equals(attrValue)) attrValue = null; try { Attribute attributeWithValue; try { attributeWithValue = attributesManagerBl.getAttribute(session, ues, attr.getName()); } catch (AttributeNotExistsException ex) { try { attributeWithValue = new Attribute(attributesManagerBl.createAttribute(session, attr)); } catch (AttributeDefinitionExistsException e) { attributeWithValue = attributesManagerBl.getAttribute(session, ues, attr.getName()); } } if(attributeWithValue.getType().equals(ArrayList.class.getName())) { log.info("TEST: storing list-type attribute (before split) " + attributeWithValue); <START> attributeWithValue.setValue(new ArrayList<String>(Arrays.asList(attrValue.split(multivalueAttributeSeparatorRegExp)))); <END> log.info("TEST: storing list-type attribute (after split) " + attributeWithValue); } else { attributeWithValue.setValue(attrValue); } log.debug("storing attribute {}='{}' for user {}", attributeWithValue.getFriendlyName(), attrValue, ues.getLogin()); attributesManagerBl.setAttribute(session, ues, attributeWithValue); } catch (AttributeNotExistsException | WrongAttributeAssignmentException | WrongAttributeValueException | WrongReferenceAttributeValueException e) { log.error("Attribute " + attr.getName() + " with value '" + attrValue + "' cannot be saved", e); } } } }</code><technical_language>better, easier for reading: List<String> = Arrays.asList(attrValue.split(multivalueAttributeSeparatorRegExp)); attributeWithValue.setValue(value);</technical_language>

Target:
public void setUserExtSourceAttributes(PerunSession session, UserExtSource ues, Map<String, String> additionalAttributes) throws InternalErrorException { List<AttributeDefinition> attrs = coreConfig.getAttributesForUpdate().get(ues.getExtSource().getType()); if (attrs != null) { for (AttributeDefinition attr : attrs) { String attrValue = additionalAttributes.get(attr.getFriendlyName()); if ("".equals(attrValue)) attrValue = null; try { Attribute attributeWithValue; try { attributeWithValue = attributesManagerBl.getAttribute(session, ues, attr.getName()); } catch (AttributeNotExistsException ex) { try { attributeWithValue = new Attribute(attributesManagerBl.createAttribute(session, attr)); } catch (AttributeDefinitionExistsException e) { attributeWithValue = attributesManagerBl.getAttribute(session, ues, attr.getName()); } } if(attributeWithValue.getType().equals(ArrayList.class.getName()) || attributeWithValue.getType().equals(BeansUtils.largeArrayListClassName)) { List<String> value = Arrays.asList(attrValue.split(UsersManagerBlImpl.multivalueAttributeSeparatorRegExp)); attributeWithValue.setValue(value); } else { attributeWithValue.setValue(attrValue); } log.debug("storing attribute {}='{}' for user {}", attributeWithValue.getFriendlyName(), attrValue, ues.getLogin()); attributesManagerBl.setAttribute(session, ues, attributeWithValue); } catch (AttributeNotExistsException | WrongAttributeAssignmentException | WrongAttributeValueException | WrongReferenceAttributeValueException e) { log.error("Attribute " + attr.getName() + " with value '" + attrValue + "' cannot be saved", e); } } } }