protected CTSheet sheet;
protected CTWorksheet worksheet;
- private SortedMap<Integer, XSSFRow> _rows;
+ private final SortedMap<Integer, XSSFRow> _rows = new TreeMap<Integer, XSSFRow>();
private List<XSSFHyperlink> hyperlinks;
private ColumnHelper columnHelper;
private CommentsTable sheetComments;
}
private void initRows(CTWorksheet worksheetParam) {
- _rows = new TreeMap<Integer, XSSFRow>();
+ _rows.clear();
tables = new TreeMap<String, XSSFTable>();
sharedFormulas = new HashMap<Integer, CTCellFormula>();
arrayFormulas = new ArrayList<CellRangeAddress>();
rowShifter.updateHyperlinks(shifter);
//rebuild the _rows map
- SortedMap<Integer, XSSFRow> map = new TreeMap<Integer, XSSFRow>();
+ Map<Integer, XSSFRow> map = new HashMap<Integer, XSSFRow>();
for(XSSFRow r : _rows.values()) {
// Performance optimization: explicit boxing is slightly faster than auto-unboxing, though may use more memory
final Integer rownumI = new Integer(r.getRowNum()); // NOSONAR
map.put(rownumI, r);
}
- _rows = map;
+ _rows.clear();
+ _rows.putAll(map);
}
private int shiftedRowNum(int startRow, int endRow, int n, int rownum) {