Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8142967

[TESTBUG] Compiler control tests get NullPointerException

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b96

      Description

      FIles.copy gets NPE because "is" is null.

      public class ClassFileInstaller {
          /**
           * @param args The names of the classes to dump
           * @throws Exception
           */
          public static void main(String... args) throws Exception {
              for (String arg : args) {
                  ClassLoader cl = ClassFileInstaller.class.getClassLoader();

                  // Convert dotted class name to a path to a class file
                  String pathName = arg.replace('.', '/').concat(".class");
                  InputStream is = cl.getResourceAsStream(pathName);

                  // Create the class file's package directory
                  Path p = Paths.get(pathName);
                  if (pathName.contains("/")) {
                      Files.createDirectories(p.getParent());
                  }
                  // Create the class file
                  Files.copy(is, p, StandardCopyOption.REPLACE_EXISTING);
              }
          }
      }

        Attachments

          Activity

            People

            • Assignee:
              ppunegov Pavel Punegov
              Reporter:
              jprovino Joseph Provino (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: