You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Ted Yu (JIRA)" <ji...@apache.org> on 2014/08/23 03:01:44 UTC

[jira] [Created] (HIVE-7862) close of InputStream in Utils#copyToZipStream() should be placed in finally block

Ted Yu created HIVE-7862:
----------------------------

             Summary: close of InputStream in Utils#copyToZipStream() should be placed in finally block
                 Key: HIVE-7862
                 URL: https://issues.apache.org/jira/browse/HIVE-7862
             Project: Hive
          Issue Type: Bug
            Reporter: Ted Yu
            Priority: Minor


In accumulo-handler/src/java/org/apache/hadoop/hive/accumulo/Utils.java , line 278 :
{code}
  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();
{code}
If read() throws IOException, is would be left unclosed.



--
This message was sent by Atlassian JIRA
(v6.2#6252)