Fix a 1.6-ism - TreeMap.firstEntry

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1148056 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2011-07-18 21:23:32 +00:00
parent ce0a61f8e6
commit 2a1dc583b6

View File

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