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

Annotate ChannelBuilder#header #277

Merged

Conversation

oleg-nenashev
Copy link
Member

Just a follow-up to @jglick 's review comment in jenkinsci/jenkins#3489
Nulls are fine according to the logic

@jglick jglick changed the title Annotate ChannelBuider#header Annotate ChannelBuilder#header Jun 13, 2018
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Fine but is not the reason for my objection to the core PR. You are demonstrating that

OutputStream headerStream = cb.getHeaderStream();
if (headerStream == null) {

is a legitimate null check. I pointed out that if you fail to then set the local variable to a non-null value, you will be calling setChannel(Channel, null, Channel.Listener), which will then call new StreamTaskListener(null), which will then call new PrintStream(null, false), which will throw NPE from requireNonNull.

@oleg-nenashev oleg-nenashev merged commit 212f14b into jenkinsci:master Jun 14, 2018
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.

2 participants