Skip to content
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

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,9 @@
</Or>
<Bug pattern="SE_BAD_FIELD" />
</Match>
<Match>
<Class name="org.apache.hadoop.yarn.service.ServiceScheduler$1"/>
<Method name="load"/>
<Bug code="NP" pattern="NP_NONNULL_RETURN_VIOLATION"/>
Copy link

@zeekling zeekling Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not delete @Nonnull

Copy link
Contributor

@slfan1989 slfan1989 Oct 1, 2024

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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewing

i see.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zeekling Do you have any other feedback or suggestions regarding this PR?
cc: @zhtttylz

</Match>
</FindBugsFilter>
Loading