<commit_before>package org.sanelib.eboss.api.converters.user;

import com.google.common.base.Strings;
import org.sanelib.eboss.api.dto.user.UserDTO;
import org.sanelib.eboss.common.utils.ReflectionHelper;
import org.sanelib.eboss.core.commands.ProcessCommand;
import org.sanelib.eboss.core.commands.user.AddUser;
import org.sanelib.eboss.core.commands.user.UpdateUser;
import org.sanelib.eboss.core.exceptions.ProcessError;

public class UpdateUserConverter extends AddUserConverter{

    @Override
    public ProcessCommand convert(UserDTO userDTO, ProcessError processError) throws NoSuchFieldException, IllegalAccessException{
        AddUser addUser = (AddUser) super.convert(userDTO , processError);

        UpdateUser updateUser = new UpdateUser();
        ReflectionHelper.copy(addUser ,updateUser);

        if(Strings.isNullOrEmpty(userDTO.getId())){
            processError.addError("common.field.required", "id" , "domain.user.id");
        }
        else{
            updateUser.setId(Integer.valueOf(userDTO.getId()));
        }<commit_msg>Fixed compilation error for converting id to long.<commit_after>package org.sanelib.eboss.api.converters.user;

import com.google.common.base.Strings;
import org.sanelib.eboss.api.dto.user.UserDTO;
import org.sanelib.eboss.common.utils.ReflectionHelper;
import org.sanelib.eboss.core.commands.ProcessCommand;
import org.sanelib.eboss.core.commands.user.AddUser;
import org.sanelib.eboss.core.commands.user.UpdateUser;
import org.sanelib.eboss.core.exceptions.ProcessError;

public class UpdateUserConverter extends AddUserConverter{

    @Override
    public ProcessCommand convert(UserDTO userDTO, ProcessError processError) throws NoSuchFieldException, IllegalAccessException{
        AddUser addUser = (AddUser) super.convert(userDTO , processError);

        UpdateUser updateUser = new UpdateUser();
        ReflectionHelper.copy(addUser ,updateUser);

        if(Strings.isNullOrEmpty(userDTO.getId())){
            processError.addError("common.field.required", "id" , "domain.user.id");
        }
        else{
            updateUser.setId(Long.valueOf(userDTO.getId()));
        }
{'fraction_non_alphanumeric': 0.10774253731343283, 'fraction_numerical': 0.0, 'mean_word_length': 4.244498777506112, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7153856', 'n_tokens_mistral': 641, 'n_tokens_neox': 646, 'n_words': 103}