includes/org/apache/poi/hssf/usermodel/HSSFRow.java
private void addCell(HSSFCell cell) {

        int column=cell.getColumnIndex();
        // re-allocate cells array as required.
        if(column>=cells.length) {
            HSSFCell[] oldCells=cells;
            int newSize=oldCells.length*2;
            if(newSize<column+1) {
                newSize=column+1;
            }
            cells=new HSSFCell[newSize];
            System.arraycopy(oldCells,0,cells,0,oldCells.length);
        }
        cells[column]=cell;

        // fix up firstCol and lastCol indexes
        if (row.isEmpty() || column < row.getFirstCol()) {
            row.setFirstCol((short)column);
        }

        if (row.isEmpty() || column >= row.getLastCol()) {
            row.setLastCol((short) (column+1)); // +1 -> for one past the last index
        }
    }
/**
     * used internally to add a cell.
     */
used internally to add a cell.
used internally to add a cell .
private void addCell(HSSFCell cell) {
        int column=cell.getColumnIndex();
        if(column>=cells.length) {
            HSSFCell[] oldCells=cells;
            int newSize=oldCells.length*2;
            if(newSize<column+1) {
                newSize=column+1;
            }
            cells=new HSSFCell[newSize];
            System.arraycopy(oldCells,0,cells,0,oldCells.length);
        }
        cells[column]=cell;
        if (row.isEmpty() || column < row.getFirstCol()) {
            row.setFirstCol((short)column);
        }
        if (row.isEmpty() || column >= row.getLastCol()) {
            row.setLastCol((short) (column+1)); 
        }
    }
private void addCell ( HSSFCell cell ) { int column = cell . getColumnIndex ( ) ; if ( column >= cells . length ) { HSSFCell [ ] oldCells = cells ; int newSize = oldCells . length * 2 ; if ( newSize < column + 1 ) { newSize = column + 1 ; } cells = new HSSFCell [ newSize ] ; System . arraycopy ( oldCells , 0 , cells , 0 , oldCells . length ) ; } cells [ column ] = cell ; if ( row . isEmpty ( ) || column < row . getFirstCol ( ) ) { row . setFirstCol ( ( short ) column ) ; } if ( row . isEmpty ( ) || column >= row . getLastCol ( ) ) { row . setLastCol ( ( short ) ( column + 1 ) ) ; } }
used internally to add a cell.
used internally to add a cell .
// re-allocate cells array as required.
 // fix up firstCol and lastCol indexes
 // +1 -> for one past the last index
