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

Sjavac does not close file given to --compare-found-sources

XMLWordPrintable

    • b101
    • windows
    • Not verified

      The file given to --compare-found-sources is not closed after being read by sjavac. This causes the build to fail on Windows since the makefile is trying to rename that file after being used and Windows won't let it because the sjavac server process is still holding a handle to it.

      Suggested patch:

      diff -r 500d36bee375 src/jdk.compiler/share/classes/com/sun/tools/sjavac/JavacState.java
      --- a/src/jdk.compiler/share/classes/com/sun/tools/sjavac/JavacState.java Wed Nov 18 16:37:12 2015 +0530
      +++ b/src/jdk.compiler/share/classes/com/sun/tools/sjavac/JavacState.java Thu Nov 19 11:54:10 2015 +0100
      @@ -954,8 +954,7 @@
                   }
               }
               // Read in the file and create another set of filenames with full paths.
      - try {
      - BufferedReader in = new BufferedReader(new FileReader(makefileSourceList));
      + try (BufferedReader in = new BufferedReader(new FileReader(makefileSourceList))) {
                   for (;;) {
                       String l = in.readLine();
                       if (l==null) break;

            alundblad Andreas Lundblad (Inactive)
            erikj Erik Joelsson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: