]> source.dussan.org Git - poi.git/commitdiff
Fix a 1.6-ism - TreeMap.firstEntry
authorNick Burch <nick@apache.org>
Mon, 18 Jul 2011 21:23:32 +0000 (21:23 +0000)
committerNick Burch <nick@apache.org>
Mon, 18 Jul 2011 21:23:32 +0000 (21:23 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1148056 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java

index d19770a91872aa4fd0922b9eb36f80bd80356d9d..c31e2fa22fd8bf3b7d8bd617719ebe30b2ce4dc5 100644 (file)
@@ -1219,14 +1219,12 @@ public class SXSSFSheet implements Sheet, Cloneable
 
     private void flushOneRow() throws IOException
     {
-        Map.Entry<Integer,SXSSFRow> firstEntry=_rows.firstEntry();
-        if(firstEntry!=null)
-        {
-            
-            SXSSFRow row=firstEntry.getValue();
-            int rowIndex=firstEntry.getKey().intValue();
-            _writer.writeRow(rowIndex,row);
-            _rows.remove(firstEntry.getKey());
+        Integer firstRowNum = _rows.firstKey();
+        if (firstRowNum!=null) {
+            int rowIndex = firstRowNum.intValue();
+            SXSSFRow row = _rows.get(firstRowNum);
+            _writer.writeRow(rowIndex, row);
+            _rows.remove(firstRowNum);
         }
     }
     public void changeRowNum(SXSSFRow row, int newRowNum)