-
Notifications
You must be signed in to change notification settings - Fork 16
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
Refactor Replicate#getLastRelevantStatus
to remove the Optional
return type
#524
Refactor Replicate#getLastRelevantStatus
to remove the Optional
return type
#524
Conversation
|
||
if (lastRelevantStatus.get().equals(ReplicateStatus.CONTRIBUTED)) { | ||
ReplicateStatus lastRelevantStatus = replicate.getLastRelevantStatus(); | ||
if (lastRelevantStatus.equals(ReplicateStatus.CONTRIBUTED)) { |
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 tend to prefer the inverted syntax for NPE protection
if (lastRelevantStatus.equals(ReplicateStatus.CONTRIBUTED)) { | |
if (ReplicateStatus.CONTRIBUTED.equals(lastRelevantStatus)) { |
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.
Using ==
is a bit better for enums. Please see 566e532 :)
src/main/java/com/iexec/core/replicate/ReplicateSupplyService.java
Outdated
Show resolved
Hide resolved
Kudos, SonarCloud Quality Gate passed! |
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.
Nice work, many thanks
PR goal: fix SonarCloud detected bugs on
Replicate#getLastRelevantStatus