Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-51955

SlaveComputer#setChannel(Channel,OutputStream,Channel.Listener) may throw null in the case of valid API usages

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The second parameter for SlaveComputer#setChannel(Channel,OutputStream,Channel.Listener) is launchLog.

      According to Javadoc of another method, it may be null. " If non-null, receive the portion of data in <tt>is</tt> before the data goes into the binary mode.

      public void setChannel(@Nonnull InputStream in, @Nonnull OutputStream out,
                                 @CheckForNull OutputStream launchLog,
                                 @CheckForNull Channel.Listener listener
      

      If somebody really passes null to that method the underlying 3-argument method will fail with NPE. Although I think that loggers should be always passed, I think that the valid fix would be to have null handling so that API users do not get into the same risk

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          This issue is a follow-up to the concern Jesse Glick raised in https://github.com/jenkinsci/remoting/pull/277#pullrequestreview-128529556 . Apparently I followed Javadoc guidelines of a wrong method, and I didn't get FindBugs warning due to the disabled annotations

          Show
          oleg_nenashev Oleg Nenashev added a comment - This issue is a follow-up to the concern Jesse Glick raised in https://github.com/jenkinsci/remoting/pull/277#pullrequestreview-128529556 . Apparently I followed Javadoc guidelines of a wrong method, and I didn't get FindBugs warning due to the disabled annotations
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Released in 2.128, marked as LTS candidate

          Show
          oleg_nenashev Oleg Nenashev added a comment - Released in 2.128, marked as LTS candidate

            People

            • Assignee:
              oleg_nenashev Oleg Nenashev
              Reporter:
              oleg_nenashev Oleg Nenashev
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: