]> source.dussan.org Git - poi.git/commitdiff
pre for-each iteration over for index iteration
authorJaven O'Neal <onealj@apache.org>
Mon, 4 Jul 2016 18:43:45 +0000 (18:43 +0000)
committerJaven O'Neal <onealj@apache.org>
Mon, 4 Jul 2016 18:43:45 +0000 (18:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1751369 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java

index 0470e66eeb29cdd0ad6f963c24db05588cca11dc..acf9ef69d46fab75b5cdda88eeedea08deff817b 100644 (file)
@@ -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<String, Integer>(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