From 49eda07ad9bd0f2385ace94414cbeb13d939d576 Mon Sep 17 00:00:00 2001 From: jjg Date: Wed, 15 Dec 2010 06:39:51 -0800 Subject: [PATCH] 7006564: NPE in javac running test/tools/javac/nio/compileTest/CompileTest.java Reviewed-by: mcimadamore, alanb --- .../classes/com/sun/tools/javac/nio/JavacPathFileManager.java | 3 ++- test/tools/javac/nio/compileTest/CompileTest.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java b/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java index 52672f81..1a129354 100644 --- a/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java +++ b/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java @@ -376,7 +376,8 @@ public class JavacPathFileManager extends BaseFileManager implements PathFileMan new SimpleFileVisitor() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) { - if (SourceVersion.isIdentifier(dir.getName().toString())) // JSR 292? + Path name = dir.getName(); + if (name == null || SourceVersion.isIdentifier(name.toString())) // JSR 292? return FileVisitResult.CONTINUE; else return FileVisitResult.SKIP_SUBTREE; diff --git a/test/tools/javac/nio/compileTest/CompileTest.java b/test/tools/javac/nio/compileTest/CompileTest.java index b93fbfe9..8ec44426 100644 --- a/test/tools/javac/nio/compileTest/CompileTest.java +++ b/test/tools/javac/nio/compileTest/CompileTest.java @@ -23,7 +23,7 @@ /** * @test - * @bug 6906175 6915476 6915497 + * @bug 6906175 6915476 6915497 7006564 * @summary Path-based JavaFileManager * @compile -g HelloPathWorld.java * @run main CompileTest -- GitLab