Fix issue with Jenkins 2.141 and changes for JENKINS-52818#149
Open
Alex-Vol-SV wants to merge 1 commit intonemccarthy:masterfrom
Open
Fix issue with Jenkins 2.141 and changes for JENKINS-52818#149Alex-Vol-SV wants to merge 1 commit intonemccarthy:masterfrom
Alex-Vol-SV wants to merge 1 commit intonemccarthy:masterfrom
Conversation
The new logic exposed this incorrect usage from this plugin. Had to add null guard because this is failing a findbugs test although the .get() method is marked with @nonnull annotation in the Jenkins core class.
|
+1 |
| JenkinsLocationConfiguration globalConfig = new JenkinsLocationConfiguration(); | ||
| String rootUrl = globalConfig.getUrl(); | ||
| JenkinsLocationConfiguration globalConfig = JenkinsLocationConfiguration.get(); | ||
| String rootUrl = globalConfig == null ? null : globalConfig.getUrl(); |
There was a problem hiding this comment.
JenkinsLocationConfiguration.get() is @Nonnull, so why check it for null?
Author
There was a problem hiding this comment.
See comment in description of this pull request. The build fails findbugs validation without the null check. Did not spend much time understanding why findbugs does not follow the @nonnull annotation.
There was a problem hiding this comment.
Sorry, I missed that part in PR description.
I was going to say that jenkinsci#26 has a passing build without the null check, but I've noticed it has no build configured
|
Unmaintained repo, unrelated to the Jenkins Project FYI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The new logic exposed this incorrect usage from this plugin.
Had to add null guard because this is failing a findbugs test
although the .get() method is marked with @nonnull annotation in
the Jenkins core class.
This fixes #148