From: Javen O'Neal Date: Mon, 4 Jul 2016 18:43:45 +0000 (+0000) Subject: pre for-each iteration over for index iteration X-Git-Tag: REL_3_15_BETA3~195 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=480703f15b589d978b7e852c3fd26be4fe4ac5a5;p=poi.git pre for-each iteration over for index iteration git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1751369 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java index 0470e66eeb..acf9ef69d4 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java @@ -293,8 +293,8 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { } /** - * @since POI 3.15 beta 3 - */ + * @since POI 3.15 beta 3 + */ private void setCellReferences() { String ref = ctTable.getRef(); if (ref != null) { @@ -399,9 +399,11 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { final int count = getTableColumns().length; columnMap = new HashMap(count * 3 / 2); - for (int i=0; i < count; i++) { - String columnName = getTableColumns()[i].getName(); + int i = 0; + for (CTTableColumn column : getTableColumns()) { + String columnName = column.getName(); columnMap.put(caseInsensitive(columnName), i); + i++; } } // Table column names with special characters need a single quote escape