8147444: compiler/jsr292/NonInlinedCall/RedefineTest.java fails with NullPointerException in ClassFileInstaller
authorthartmann
Mon, 18 Jan 2016 08:25:26 +0100
changeset 35572 c864053d0405
parent 35570 584ae5cfe100
child 35573 e6c6e7a3b036
8147444: compiler/jsr292/NonInlinedCall/RedefineTest.java fails with NullPointerException in ClassFileInstaller Summary: Removed installing of unused class. Added error output to ClassFileInstaller. Reviewed-by: vlivanov, zmajo
hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java
hotspot/test/testlibrary/ClassFileInstaller.java
--- a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java	Fri Jan 15 13:08:40 2016 -1000
+++ b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java	Mon Jan 18 08:25:26 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  *                              java.lang.invoke.RedefineTest
  *                              Agent
- *                              jdk.test.lib.Asserts
  * @run main Agent agent.jar java.lang.invoke.RedefineTest
  * @run main/othervm -Xbootclasspath/a:. -javaagent:agent.jar
  *                   -XX:+IgnoreUnrecognizedVMOptions
--- a/hotspot/test/testlibrary/ClassFileInstaller.java	Fri Jan 15 13:08:40 2016 -1000
+++ b/hotspot/test/testlibrary/ClassFileInstaller.java	Mon Jan 18 08:25:26 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,6 +21,7 @@
  * questions.
  */
 
+import java.io.FileNotFoundException;
 import java.io.InputStream;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -42,6 +43,9 @@
             // Convert dotted class name to a path to a class file
             String pathName = arg.replace('.', '/').concat(".class");
             InputStream is = cl.getResourceAsStream(pathName);
+            if (is == null) {
+                throw new FileNotFoundException(pathName);
+            }
 
             // Create the class file's package directory
             Path p = Paths.get(pathName);