Source:
<code>public HashMap<User, List<Attribute>> getRequiredAttributes(PerunSession sess, Service service, List<User> users) throws InternalErrorException { if(!CacheManager.isCacheDisabled() && !perun.getCacheManager().wasCacheUpdatedInTransaction()) { List<Integer> attrIds = getRequiredAttributeIds(service); HashMap<User, List<Attribute>> hashMap = new HashMap<>(); for (User user: users) { List<Attribute> attrs = perun.getCacheManager().getAttributesByIds(attrIds, new Holder(user.getId(), Holder.HolderType.USER)); List<Attribute> setAttrs = this.setValuesOfAttributes(sess, attrs, user, null); hashMap.put(user, setAttrs); } return hashMap; } try { return jdbc.execute("SELECT " + getAttributeMappingSelectQuery("usr") + ", users.id FROM attr_names " + "JOIN service_required_attrs on attr_names.id=service_required_attrs.attr_id AND service_required_attrs.service_id=? " + "JOIN users ON users.id " + Compatibility.getStructureForInClause() + "LEFT JOIN user_attr_values usr ON attr_names.id=usr.attr_id AND user_id=users.id " + "WHERE namespace IN (?,?,?,?)", (PreparedStatementCallback<HashMap<User, List<Attribute>>>) preparedStatement -> { Array sqlArray = ((PerunBlImpl) perun).getDatabaseManagerBl().prepareSQLArrayOfNumbers(users, preparedStatement); preparedStatement.setInt(1, service.getId()); preparedStatement.setArray(2, sqlArray); <START> preparedStatement.setNString(3, AttributesManager.NS_USER_ATTR_CORE); <END> preparedStatement.setNString(4, AttributesManager.NS_USER_ATTR_DEF); preparedStatement.setNString(5, AttributesManager.NS_USER_ATTR_OPT); preparedStatement.setNString(6, AttributesManager.NS_USER_ATTR_VIRT); UserAttributeExtractor userAttributeExtractor = new UserAttributeExtractor(sess, this, users); return userAttributeExtractor.extractData(preparedStatement.executeQuery()); }); } catch (InternalErrorRuntimeException ex) { throw new InternalErrorException(ex); } }</code><technical_language>dtto, setString()</technical_language>

Target:
public HashMap<User, List<Attribute>> getRequiredAttributes(PerunSession sess, Service service, List<User> users) throws InternalErrorException { if(!CacheManager.isCacheDisabled() && !perun.getCacheManager().wasCacheUpdatedInTransaction()) { List<Integer> attrIds = getRequiredAttributeIds(service); HashMap<User, List<Attribute>> hashMap = new HashMap<>(); for (User user: users) { List<Attribute> attrs = perun.getCacheManager().getAttributesByIds(attrIds, new Holder(user.getId(), Holder.HolderType.USER)); List<Attribute> setAttrs = this.setValuesOfAttributes(sess, attrs, user, null); hashMap.put(user, setAttrs); } return hashMap; } try { return jdbc.execute("SELECT " + getAttributeMappingSelectQuery("usr") + ", users.id FROM attr_names " + "JOIN service_required_attrs on attr_names.id=service_required_attrs.attr_id AND service_required_attrs.service_id=? " + "JOIN users ON users.id " + Compatibility.getStructureForInClause() + "LEFT JOIN user_attr_values usr ON attr_names.id=usr.attr_id AND user_id=users.id " + "WHERE namespace IN (?,?,?,?)", (PreparedStatementCallback<HashMap<User, List<Attribute>>>) preparedStatement -> { Array sqlArray = ((PerunBlImpl) perun).getDatabaseManagerBl().prepareSQLArrayOfNumbers(users, preparedStatement); preparedStatement.setInt(1, service.getId()); preparedStatement.setArray(2, sqlArray); preparedStatement.setString(3, AttributesManager.NS_USER_ATTR_CORE); preparedStatement.setString(4, AttributesManager.NS_USER_ATTR_DEF); preparedStatement.setString(5, AttributesManager.NS_USER_ATTR_OPT); preparedStatement.setString(6, AttributesManager.NS_USER_ATTR_VIRT); UserAttributeExtractor userAttributeExtractor = new UserAttributeExtractor(sess, this, users); return userAttributeExtractor.extractData(preparedStatement.executeQuery()); }); } catch (InternalErrorRuntimeException ex) { throw new InternalErrorException(ex); } }