Alex Dommasch created SSHD-435:
----------------------------------

             Summary: internal NPE when trying to sendStatus, sparse feedback 
as to root cause
                 Key: SSHD-435
                 URL: https://issues.apache.org/jira/browse/SSHD-435
             Project: MINA SSHD
          Issue Type: Bug
    Affects Versions: 0.14.0
            Reporter: Alex Dommasch


When trying to implement a virtual FileSystemView with the SftpSubsystem, there 
is a corner case that gives very little feedback as to the root cause.  Namely, 
if, within a directory listing, one of the SshFile entries returns false for 
doesExist, and null for getAbsolutePath, there is an internal 
NullPointerException when trying to generate the response.  (When doesExist is 
false, a FileNotFoundException is thrown by writeAttrs, with getAbsolutePath 
used as the message.  But sendStatus wrongly assumes e.getMessage() is 
non-null, triggering a NullPointerException in putString, obscuring the root 
cause.)

A few possible suggestions:
* guard code to handle this corner case without internal exceptions
* further documentation on implementation requirements for a virtual file 
system (what needs to be implemented under which circumstances)
* fail fast, with a helpful message, when an implementation fails to uphold a 
documented contract.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to