8147444: compiler/jsr292/NonInlinedCall/RedefineTest.java fails with NullPointerException in ClassFileInstaller

Removed installing of unused class. Added error output to ClassFileInstaller.

Reviewed-by: vlivanov, zmajo
This commit is contained in:
Tobias Hartmann 2016-01-18 08:25:26 +01:00
parent 01f58aa4da
commit 90ac004ff6
2 changed files with 6 additions and 3 deletions

View file

@ -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

View file

@ -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 @@ public class ClassFileInstaller {
// 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);