[ 
https://issues.apache.org/jira/browse/DERBY-6396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13807910#comment-13807910
 ] 

Knut Anders Hatlen commented on DERBY-6396:
-------------------------------------------

Thanks, Fabian. It makes sense that this could happen if the directory lives on 
a network drive.

I guess at some point we should rewrite most of this code to use the 
java.nio.file classes instead of java.io.File, as they will give better error 
reporting in these cases (an IOException with a proper error message, rather 
than a boolean return value with no information about what went wrong). But 
that's new functionality in Java 7, and Derby has to work on Java 6 too for 
now, so that will have to wait.

> NullPointerException in DirFile
> -------------------------------
>
>                 Key: DERBY-6396
>                 URL: https://issues.apache.org/jira/browse/DERBY-6396
>             Project: Derby
>          Issue Type: Bug
>          Components: Miscellaneous
>    Affects Versions: 10.10.1.1
>         Environment: Windows 7
>            Reporter: Fabian Depry
>            Assignee: Knut Anders Hatlen
>         Attachments: check-null.diff
>
>
> We got a NullPointerException trying to start a Derby database in embedded 
> mode; the stacktrace indicated it happened in 
> org.apache.derby.impl.io.DirFile.deleteAll(); that method got called from 
> org.apache.derby.impl.io.BaseStorageFactory.createTempDir().
> After investigating, it appears that the deleteAll() method calls 
> "super.list()", which according to the java.io.File specifications, can 
> return null. But the deleteAll() method doesn't handle that case gracefully.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to