-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
YARN-11734. Fix spotbugs in ServiceScheduler#load #7088
Conversation
🎊 +1 overall
This message was automatically generated. |
<Match> | ||
<Class name="org.apache.hadoop.yarn.service.ServiceScheduler$1"/> | ||
<Method name="load"/> | ||
<Bug code="NP" pattern="NP_NONNULL_RETURN_VIOLATION"/> |
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.
Why not delete @Nonnull
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.
@zeekling The reason for modifying this PR is that SpotBugs flagged the following issue.
NP org.apache.hadoop.yarn.service.ServiceScheduler$1.load(ConfigFile) may return null, but is declared @Nonnull
[Bug type NP_NONNULL_RETURN_VIOLATION]
In class org.apache.hadoop.yarn.service.ServiceScheduler$1
In method org.apache.hadoop.yarn.service.ServiceScheduler$1.load(ConfigFile)
At ServiceScheduler.java:[line 558]
The @Nonnull
annotation is from the Guava package, so we can't modify it. However, after carefully reviewing the code, adding a rule is a more straightforward solution. From my personal perspective, this change is acceptable.
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.
reviewing
i see.
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.
@zhtttylz Thank you for your contribution! LGTM. We need to remove the following rule: [
|
Thanks a lot for your feedback! I'll make the necessary changes to the code as soon as possible. |
🎊 +1 overall
This message was automatically generated. |
Thanks @slfan1989 @zeekling help review and merged. |
JIRA:YARN-11734. Fix spotbugs in ServiceScheduler#load.