From 1380f29e6291f19ac468733ab10e8f3dc2c5caac Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Mon, 18 Jul 2011 21:23:32 +0000 Subject: [PATCH] Fix a 1.6-ism - TreeMap.firstEntry git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1148056 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/xssf/streaming/SXSSFSheet.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java index d19770a918..c31e2fa22f 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java @@ -1219,14 +1219,12 @@ public class SXSSFSheet implements Sheet, Cloneable private void flushOneRow() throws IOException { - Map.Entry 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) -- 2.39.5