Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-7862

close of InputStream in Utils#copyToZipStream() should be placed in finally block

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Minor
    • Resolution: Unresolved
    • 0.13.0
    • None
    • None

    Description

      In accumulo-handler/src/java/org/apache/hadoop/hive/accumulo/Utils.java , line 278 :

        private static void copyToZipStream(InputStream is, ZipEntry entry, ZipOutputStream zos)
            throws IOException {
          zos.putNextEntry(entry);
          byte[] arr = new byte[4096];
          int read = is.read(arr);
          while (read > -1) {
            zos.write(arr, 0, read);
            read = is.read(arr);
          }
          is.close();
      

      If read() throws IOException, is would be left unclosed.

      Attachments

        1. HIVE-7862_001.txt
          1 kB
          skrho
        2. HIVE-7862.1.patch
          1 kB
          Ted Yu
        3. HIVE-7862.1.patch
          1 kB
          Ted Yu

        Activity

          People

            rsk13th skrho
            yuzhihong@gmail.com Ted Yu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: