Return-Path: X-Original-To: apmail-accumulo-notifications-archive@minotaur.apache.org Delivered-To: apmail-accumulo-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 142D91790B for ; Thu, 9 Apr 2015 21:30:13 +0000 (UTC) Received: (qmail 50894 invoked by uid 500); 9 Apr 2015 21:30:13 -0000 Delivered-To: apmail-accumulo-notifications-archive@accumulo.apache.org Received: (qmail 50857 invoked by uid 500); 9 Apr 2015 21:30:13 -0000 Mailing-List: contact notifications-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@apache.org Delivered-To: mailing list notifications@accumulo.apache.org Received: (qmail 50843 invoked by uid 99); 9 Apr 2015 21:30:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Apr 2015 21:30:12 +0000 Date: Thu, 9 Apr 2015 21:30:12 +0000 (UTC) From: "Christopher Tubbs (JIRA)" To: notifications@accumulo.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ACCUMULO-2131) while statement used as if statement MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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)