<commit_before>package com.hantsylabs.restexample.springmvc.api.user;

import com.hantsylabs.restexample.springmvc.Constants;
import com.hantsylabs.restexample.springmvc.domain.User;
import com.hantsylabs.restexample.springmvc.exception.InvalidRequestException;
import com.hantsylabs.restexample.springmvc.model.PasswordForm;
import com.hantsylabs.restexample.springmvc.model.ProfileForm;
import com.hantsylabs.restexample.springmvc.model.UserDetails;
import com.hantsylabs.restexample.springmvc.security.CurrentUser;
import com.hantsylabs.restexample.springmvc.service.UserService;
import javax.inject.Inject;
import javax.validation.Valid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = Constants.URI_API_PREFIX + Constants.URI_SELF)
public class CurrentUserController {

    private static final Logger log = LoggerFactory
            .getLogger(CurrentUserController.class);

    @Inject
    private UserService userService;

//    @RequestMapping(value = "", method = RequestMethod.GET)
//    @ResponseBody
    @PostMapping()
    public UserDetails currentUser(@CurrentUser User user) {

        log.debug("get current user info");

        UserDetails details = userService.findUserById(user.getId());

        log.debug("current user value @" + details);

        return details;<commit_msg>fixed issue #9<commit_after>package com.hantsylabs.restexample.springmvc.api.user;

import com.hantsylabs.restexample.springmvc.Constants;
import com.hantsylabs.restexample.springmvc.domain.User;
import com.hantsylabs.restexample.springmvc.exception.InvalidRequestException;
import com.hantsylabs.restexample.springmvc.model.PasswordForm;
import com.hantsylabs.restexample.springmvc.model.ProfileForm;
import com.hantsylabs.restexample.springmvc.model.UserDetails;
import com.hantsylabs.restexample.springmvc.security.CurrentUser;
import com.hantsylabs.restexample.springmvc.service.UserService;
import javax.inject.Inject;
import javax.validation.Valid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = Constants.URI_API_PREFIX + Constants.URI_SELF)
public class CurrentUserController {

    private static final Logger log = LoggerFactory
            .getLogger(CurrentUserController.class);

    @Inject
    private UserService userService;

//    @RequestMapping(value = "", method = RequestMethod.GET)
//    @ResponseBody
    @GetMapping()
    public UserDetails currentUser(@CurrentUser User user) {

        log.debug("get current user info");

        UserDetails details = userService.findUserById(user.getId());

        log.debug("current user value @" + details);

        return details;
{'fraction_non_alphanumeric': 0.09535724214623297, 'fraction_numerical': 0.0013900472616068947, 'mean_word_length': 5.553734061930784, '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': '6651781', 'n_tokens_mistral': 1018, 'n_tokens_neox': 1008, 'n_words': 167}