Thanks for having a look! If we change it to an Integer we might be coupling our interface to a specific ssh driver behavior. Also no one expects a exitStatus to be null (it's kind of weird) and the client code usually looks like "if status == 0 then ...".
What about setting it to -1? This logic can be done in the ExecResponse constructor. Commands return 0 on success and >0 on error, so -1 should be a safe value. El 19/1/2016 7:15 a. m., "Reijhanniel Jearl Campos" <devc...@gmail.com> escribió: > Hi, > > Saw this ticket[1], where it described that the sshj *Command*'s > *output.getStatus()[2] > *may return *null* but is assigned to a primitive *int*. Did a quick search > as to whether there are bug reports that were due to this, but found none, > so couldn't exactly reproduce a test case where it would return null. > > With that said, I intend to write a PR where: > 1. The connection is closed before the response is returned (as described > in the ticket) > 2. And change the ExecResponse[3] to Integer, instead of int. > > I might be missing something. Thoughts? > > RJ > > [1] https://issues.apache.org/jira/browse/JCLOUDS-1053 > [2] > > https://github.com/jclouds/jclouds/blob/master/drivers/sshj/src/main/java/org/jclouds/sshj/SshjSshClient.java#L463 > [3] > > https://github.com/jclouds/jclouds/blob/master/compute/src/main/java/org/jclouds/compute/domain/ExecResponse.java#L27 >