<commit_before>package com.api.service;

import com.api.domain.entity.QUser;
import com.api.repository.UserRepository;
import com.api.domain.entity.User;
import com.api.domain.other.Permission;
import com.querydsl.core.types.Predicate;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;

/**
 * Created by cchristo on 17/03/2017.
 */
@Service
public class UserService extends BaseService<User, Integer> {

	@Autowired
	private UserRepository userRepository;

	@Autowired
	private PasswordEncoder passwordEncoder;

	@Override
	public Predicate getPermissionPredicate(User principalUser, Permission permission) {
		return null; //QUser.user.id.in(userRepository.findAllAuthorisedUserIdsForUser(principalUser.getId()));
	}

	@Override
	public User save(User principalUser, User user) {
		user.setPassword(passwordEncoder.encode(user.getPassword()));
		List<User> users = new ArrayList<>();
		users.add(user);
		return save(users).iterator().next();<commit_msg>made save on users call the base save method<commit_after>package com.api.service;

import com.api.domain.entity.QUser;
import com.api.repository.UserRepository;
import com.api.domain.entity.User;
import com.api.domain.other.Permission;
import com.querydsl.core.types.Predicate;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;

/**
 * Created by cchristo on 17/03/2017.
 */
@Service
public class UserService extends BaseService<User, Integer> {

	@Autowired
	private UserRepository userRepository;

	@Autowired
	private PasswordEncoder passwordEncoder;

	@Override
	public Predicate getPermissionPredicate(User principalUser, Permission permission) {
		return null; //QUser.user.id.in(userRepository.findAllAuthorisedUserIdsForUser(principalUser.getId()));
	}

	@Override
	public User save(User principalUser, User user) {
		user.setPassword(passwordEncoder.encode(user.getPassword()));
		return super.save(principalUser, user);
{'fraction_non_alphanumeric': 0.10666666666666667, 'fraction_numerical': 0.006666666666666667, 'mean_word_length': 6.061764705882353, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2268373', 'n_tokens_mistral': 718, 'n_tokens_neox': 697, 'n_words': 149}