8194968: problem list actions for tools/javac/jvm/VerboseOutTest
authorjjg
Thu, 03 May 2018 12:56:53 -0700
changeset 49975 2882764cc79c
parent 49974 b7be5758a838
child 49976 19829b375d08
8194968: problem list actions for tools/javac/jvm/VerboseOutTest Reviewed-by: vromero
src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/JNIWriter.java
src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java
test/langtools/tools/javac/jvm/VerboseOutTest.java
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/JNIWriter.java	Thu May 03 12:13:43 2018 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/JNIWriter.java	Thu May 03 12:56:53 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, 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
@@ -190,7 +190,7 @@
         try {
             write(out, c);
             if (verbose)
-                log.printVerbose("wrote.file", outFile);
+                log.printVerbose("wrote.file", outFile.getName());
             out.close();
             out = null;
         } finally {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Thu May 03 12:13:43 2018 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Thu May 03 12:56:53 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, 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
@@ -784,7 +784,7 @@
             try (BufferedWriter out = new BufferedWriter(outFile.openWriter())) {
                 new Pretty(out, true).printUnit(env.toplevel, cdef);
                 if (verbose)
-                    log.printVerbose("wrote.file", outFile);
+                    log.printVerbose("wrote.file", outFile.getName());
             }
             return outFile;
         }
--- a/test/langtools/tools/javac/jvm/VerboseOutTest.java	Thu May 03 12:13:43 2018 -0700
+++ b/test/langtools/tools/javac/jvm/VerboseOutTest.java	Thu May 03 12:56:53 2018 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8194893
+ * @bug 8194893 8194968
  * @summary javac -verbose prints wrong paths for output files
  * @modules jdk.compiler
  * @run main VerboseOutTest
@@ -56,7 +56,7 @@
         if (rc != 0) {
             throw new Exception("compilation failed: rc=" + rc);
         }
-        String expected = "[wrote ./" + className + ".class]";
+        String expected = "[wrote " + Paths.get(".").resolve(className + ".class") + "]";
         if (!log.contains(expected)) {
             throw new Exception("expected output not found: " + expected);
         }