|summary:||This bug was lying in wait. JPA woke it up.|
|date:||2008-08-04 07:31:28 UTC (8 years)|
|message:||This bug was lying in wait.
JPA woke it up.
java.io.File.listFiles() has the vexing property of doing two different things in the 2 kinds of negative cases:
(1) if the directory has no files in it -- it returns an empty array
(2) if the directory is not really a directory -- a NPE is thrown
Embedded located this bug. I deployed a simple war that has no class files. Thus it has no WEB-INF/lib directory.
Nevertheless File.listFiles() was called on the bogus directory anyways.
Fix: make sure the file is a bona fide directory before using it.