7127235: (fs) NPE in Files.walkFileTree if cached attributes are GC'ed
Reviewed-by: forax, chegar
--- a/jdk/src/share/classes/java/nio/file/FileTreeWalker.java Wed Jan 04 03:49:35 2012 -0800
+++ b/jdk/src/share/classes/java/nio/file/FileTreeWalker.java Fri Jan 06 15:00:22 2012 +0000
@@ -92,7 +92,7 @@
(System.getSecurityManager() == null))
{
BasicFileAttributes cached = ((BasicFileAttributesHolder)file).get();
- if (!followLinks || !cached.isSymbolicLink())
+ if (cached != null && (!followLinks || !cached.isSymbolicLink()))
attrs = cached;
}
IOException exc = null;