accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Havanki (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ACCUMULO-2187) Scanner is left unclosed in AddSplitsCommand#execute()
Date Mon, 03 Mar 2014 15:55:25 GMT

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

Bill Havanki commented on ACCUMULO-2187:
----------------------------------------

Can you add a unit test for the refactored method, and also add @param and @return to the
Javadoc?

> Scanner is left unclosed in AddSplitsCommand#execute()
> ------------------------------------------------------
>
>                 Key: ACCUMULO-2187
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-2187
>             Project: Accumulo
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: Vikram Srivastava
>            Priority: Minor
>              Labels: newbie
>             Fix For: 1.7.0
>
>         Attachments: ACCUMULO-2187.v1.patch.txt
>
>
> Here is related code:
> {code}
>       java.util.Scanner file = new java.util.Scanner(new File(f));
>       while (file.hasNextLine()) {
>         line = file.nextLine();
>         if (!line.isEmpty()) {
>           splits.add(decode ? new Text(Base64.decodeBase64(line.getBytes())) : new Text(line));
>         }
>       }
> {code}
> file should be closed upon return.



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

Mime
View raw message