accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Tubbs (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ACCUMULO-2131) while statement used as if statement
Date Thu, 09 Apr 2015 21:30:12 GMT

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

Christopher Tubbs commented on ACCUMULO-2131:
---------------------------------------------

Yes, but it's not clear which is the preferred solution, based on Keith's comments. Bob's
patch "fixes" the problem one way, and mine "fixes" it the other way. I submitted my patch
to get feedback from Keith on which would be better.

After discussing with him, I'm going to do the least risky thing, and apply Bob's patch, which
does not change the behavior, and leave my patch here, in case this issue needs to be revisited
(for example, if the current behavior results in a bug that the loop would fix).

> while statement used as if statement
> ------------------------------------
>
>                 Key: ACCUMULO-2131
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-2131
>             Project: Accumulo
>          Issue Type: Bug
>          Components: tserver
>            Reporter: Eric Newton
>            Assignee: Bob Thorman
>            Priority: Trivial
>              Labels: newbie
>             Fix For: 1.7.0
>
>         Attachments: 0001-ACCUMULO-2131-Ensure-source-is-re-checked-for-being-.patch,
ACCUMULO-2131.patch
>
>
> Going through PMD output, and this looks a little sketchy in SourceSwitchingIterator.java:
> {noformat}
>   private boolean switchSource() throws IOException {
>     while (!source.isCurrent()) {
>       source = source.getNewDataSource();
>       iter = source.iterator();
>       if (iflag != null)
>         ((InterruptibleIterator) iter).setInterruptFlag(iflag);
>       
>       return true;
>     }
>     
>     return false;
>   }
> {noformat}
> I'm wondering if that "while" should be "if"



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

Mime
View raw message