-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify Code AccountResource #12922
Conversation
throw new InvalidPasswordException(); | ||
} | ||
<%_ if (!reactive) { _%> | ||
Optional<<%= asEntity('User') %>> user = | ||
userService.completePasswordReset(keyAndPassword.getNewPassword(), keyAndPassword.getKey()); | ||
|
||
if (!user.isPresent()) { | ||
if (user.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're still supporting Java8, so we can't use this newer API
@@ -377,7 +377,7 @@ public class AccountResource { | |||
*/ | |||
@PostMapping(path = "/account/change-password") | |||
public <% if (reactive) { %>Mono<Void><% } else { %>void<% } %> changePassword(@RequestBody PasswordChangeDTO passwordChangeDto) { | |||
if (!checkPasswordLength(passwordChangeDto.getNewPassword())) { | |||
if (checkPasswordLength(passwordChangeDto.getNewPassword())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced that inverting the meaning of checkPasswordLength
is an improvement.
Or propose a new meaningful name for this method as e.g. isPasswordLengthInvalid
Please consider squashing your commits and git force pushing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Boolean method 'checkPasswordLength' is always inverted
Inspection info: Reports methods with a boolean return type, which are only used in a negated context
Please make sure the below checklist is followed for Pull Requests.
When you are still working on the PR, consider converting it to Draft (bellow reviewers) and adding
skip-ci
label, you can still see CI build result at your branch.