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

Cleanup hudson.remoting.Channel.Ref - NPE et al. #153

Merged
merged 1 commit into from
Mar 7, 2017

Conversation

oleg-nenashev
Copy link
Member

This is an aggregated PR, cleans up the class implementation

  • Fix the NPE risk introduced by @kohsuke in 0d8a2af
  • Add name to toString() in order to display names for terminated channels
  • Update Javadoc and annotations

0d8a2af also introduces the incompatible change of Ref#clear(), but it's fine this the class is package-internal

@reviewbybees, esp. @stephenc as a creator of this class

This is an aggregated PR, cleans up the class implementation

- [x] Fix the NPE risk introduced by @kohsuke in jenkinsci@0d8a2af
- [x] Add name to toString() in order to display names for terminated channels
- [x] Update Javadoc and annotations

jenkinsci@0d8a2af also introduces the incompatible change of Ref#clear(), but it's fine this the class is package-internal
@ghost
Copy link

ghost commented Mar 6, 2017

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

@oleg-nenashev
Copy link
Member Author

@reviewbybees done

@oleg-nenashev oleg-nenashev merged commit 865a3f7 into jenkinsci:master Mar 7, 2017
@@ -1734,7 +1736,7 @@ public static void dumpDiagnosticsForAll(@Nonnull PrintWriter w) {
* @param channel the {@link Channel}.
*/
private Ref(@CheckForNull Channel channel) {
this.name = channel.getName();
this.name = channel != null ? channel.getName() : "unknown (null reference)";
Copy link
Member

Choose a reason for hiding this comment

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

Where was FindBugs before?

Copy link
Member Author

Choose a reason for hiding this comment

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

FindBugs prints warnings, but it does not fail the build now. I am handling it as https://issues.jenkins-ci.org/browse/JENKINS-37566 . One year ago there were more than 100 failures, once I merge the pending PRs there should be only 10 left

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants