8027803: test/sun/reflect/AnonymousNewInstance/ManyNewInstanceAnonTest.java fails
Summary: fix NPE in test infrastructure
Reviewed-by: ksrini, jfranck, alanb, rfield
Contributed-by: alan.bateman@oracle.com
diff --git a/test/lib/testlibrary/ClassFileInstaller.java b/test/lib/testlibrary/ClassFileInstaller.java
index 694223e..dd8777b 100644
--- a/test/lib/testlibrary/ClassFileInstaller.java
+++ b/test/lib/testlibrary/ClassFileInstaller.java
@@ -45,7 +45,10 @@
// Create the class file's package directory
Path p = Paths.get(pathName);
- Files.createDirectories(p.getParent());
+ Path parent = p.getParent();
+ if (parent != null) {
+ Files.createDirectories(parent);
+ }
// Create the class file
Files.copy(is, p, StandardCopyOption.REPLACE_EXISTING);
}