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 AF8F2109C4 for ; Tue, 11 Feb 2014 19:52:37 +0000 (UTC) Received: (qmail 30962 invoked by uid 500); 11 Feb 2014 19:52:30 -0000 Delivered-To: apmail-accumulo-notifications-archive@accumulo.apache.org Received: (qmail 30832 invoked by uid 500); 11 Feb 2014 19:52:24 -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 30678 invoked by uid 99); 11 Feb 2014 19:52:21 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Feb 2014 19:52:21 +0000 Date: Tue, 11 Feb 2014 19:52:21 +0000 (UTC) From: "Keith Turner (JIRA)" To: notifications@accumulo.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ACCUMULO-2345) Improve ConstraintChecker.check 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-2345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13898230#comment-13898230 ] Keith Turner commented on ACCUMULO-2345: ---------------------------------------- I think the current patch cleans up the code nicely and just needs a slight tweak. Just change it to initially set Violations to null and later handle the case of it being null. Leave the changes to the first if stmt as it is in the patch. I am not sure why the throwable was kept and then later checked w/ an else if. Moving that code into the catch looks so much nicer. To make the code more concise, could possibly have a private static method that does the null check, {{violations = addViolations(violations, violation)}} > Improve ConstraintChecker.check > ------------------------------- > > Key: ACCUMULO-2345 > URL: https://issues.apache.org/jira/browse/ACCUMULO-2345 > Project: Accumulo > Issue Type: Improvement > Components: tserver > Affects Versions: 1.7.0 > Reporter: Vikram Srivastava > Assignee: Vikram Srivastava > Priority: Trivial > Fix For: 1.7.0 > > Attachments: ACCUMULO-2345.v1.patch.txt > > > The if-else condition inside {{for}} loop can be merged with try-catch since {{throwable}} is not null only if code goes inside the catch section. -- This message was sent by Atlassian JIRA (v6.1.5#6160)