You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generated a new project with JHipster 8.6.0
The AccountResource.java has an unnecessary SuppressWarning here:
/**
* {@code GET /account} : get the current user.
*
* @param principal the current user; resolves to {@code null} if not authenticated.
* @return the current user.
* @throws AccountResourceException {@code 500 (Internal Server Error)} if the user couldn't be returned.
*/
@GetMapping("/account")
@SuppressWarnings("unchecked")
public AdminUserDTO getAccount(Principal principal) {
if (principal instanceof AbstractAuthenticationToken) {
return userService.getUserFromAuthentication((AbstractAuthenticationToken) principal);
} else {
throw new AccountResourceException("User could not be found");
}
}
Motivation for or Use Case
Code should always be minimal
The text was updated successfully, but these errors were encountered:
This fixes this one occurrence of the error.
The be safe that it does not occur again, the generator should have tests that every method is checked - at least check that the suppresswarning is not added when the method does not even have a "throws" declaration at all
Overview of the feature request
Generated a new project with JHipster 8.6.0
The AccountResource.java has an unnecessary SuppressWarning here:
Motivation for or Use Case
Code should always be minimal
The text was updated successfully, but these errors were encountered: