Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C87D911176 for ; Tue, 23 Sep 2014 14:55:42 +0000 (UTC) Received: (qmail 25905 invoked by uid 500); 23 Sep 2014 14:29:34 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 25876 invoked by uid 500); 23 Sep 2014 14:29:34 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 25863 invoked by uid 99); 23 Sep 2014 14:29:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Sep 2014 14:29:34 +0000 Date: Tue, 23 Sep 2014 14:29:34 +0000 (UTC) From: "Ashish Singhi (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-12060) Replace enhanced for statement with basic for statement where possible 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/HBASE-12060?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14144834#comment-14144834 ] Ashish Singhi commented on HBASE-12060: --------------------------------------- There are around 4000 for loops in trunk source code. I was thinking whether is it possible to divide this jira into sub task module wise to avoid rebase of patch if someone commits something into the trunk code and also reviewer will be able to review easily. Also we can take up critical module first and then the rest. > Replace enhanced for statement with basic for statement where possible > ---------------------------------------------------------------------- > > Key: HBASE-12060 > URL: https://issues.apache.org/jira/browse/HBASE-12060 > Project: HBase > Issue Type: Sub-task > Reporter: Andrew Purtell > Labels: beginner, beginners > > Wherever we use the enhanced for construction: > {noformat} > for ( FormalParameter : Expression ) Statement > {noformat} > where the Expression evaluates to an array or collection type that supports random access, we can avoid creating iterator objects, unless we are also using the iterator to remove items while iterating by using the basic for statement instead: > {noformat} > for ( ForInit ; Expression ; ForUpdate ) Statement > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)