hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hadoop QA (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-11414) Close of Reader should be enclosed in finally block in FileBasedIPList#readLines()
Date Wed, 17 Dec 2014 06:11:13 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-11414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14249532#comment-14249532
] 

Hadoop QA commented on HADOOP-11414:
------------------------------------

{color:red}-1 overall{color}.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12687679/HADOOP-11414.1.patch
  against trunk revision e996a1b.

    {color:red}-1 patch{color}.  The patch command could not apply the patch.

Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/5286//console

This message is automatically generated.

> Close of Reader should be enclosed in finally block in FileBasedIPList#readLines()
> ----------------------------------------------------------------------------------
>
>                 Key: HADOOP-11414
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11414
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: Tsuyoshi OZAWA
>            Priority: Minor
>         Attachments: HADOOP-11414.1.patch
>
>
> {code}
>           Reader fileReader = new InputStreamReader(
>               new FileInputStream(file), Charsets.UTF_8);
>           BufferedReader bufferedReader = new BufferedReader(fileReader);
>           List<String> lines = new ArrayList<String>();
>           String line = null;
>           while ((line = bufferedReader.readLine()) != null) {
>             lines.add(line);
>           }
>           bufferedReader.close();
> {code}
> Since bufferedReader.readLine() may throw IOE, so the close of bufferedReader should
be enclosed within finally block.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message