title: sheet.getLastRowNum() function gives invalid count with Apache POI 3.9
body: <p>I am using Apache POI 3.9 for xls and xlsx file processing.</p>
  
  <p>As per the logic, I want to iterate over each row and want to collect data for further processing. For that I am using sheet.getLastRowNum() to  retrieve number of rows in the xls sheet.</p>
  
  <p>But it seems that sheet.getLastRowNum() gives wrong count if number of records are more than 10.</p>
  
  <p>It works fine if total number of rows are 10. Otherwise it gives result deducted by one.
     i.e If there are 15 row in the sheet then It gives 14 as Last Row number.</p>
  
  <p>Can Anyone suggest me,How to solve this problem ??</p>
  
  <p>Here is the code that i am using to collect the data ...</p>
  
  <pre><code>public static List&lt;LinkedList&lt;String&gt;&gt; populateExcelSheetContentWithHeader(Sheet sheet,int columnsCount,int rowsCount) throws Exception{
          Row row = null;
  
          List&lt;LinkedList&lt;String&gt;&gt; excelFileRecordsList = new LinkedList&lt;LinkedList&lt;String&gt;&gt;();                   
          int emptyColCount = 0;      
  
          String freeTextData = null;
          LinkedList&lt;String&gt; excelFileDataList =null;
  
          int actualRows = sheet.getLastRowNum();
  
          if (actualRows &lt; rowsCount) {
              rowsCount = actualRows;
          }
  
  
          ///ITERATE OVER EACH ROW AND POPULATE THE DATA
          for(int index=0;index&lt;rowsCount;index++){
  
              row = sheet.getRow(index);
  
              if(row!=null){
                  emptyColCount = 0;
                  excelFileDataList =new LinkedList&lt;String&gt;();
  
                  for(int colIndex=0;colIndex&lt;columnsCount;colIndex++){
                      freeTextData = "";
  
                      if(isEmptyCell(row.getCell(colIndex))){
                          emptyColCount++;
                      }else{
                          freeTextData = getCellValue(row.getCell(colIndex),false);
                      }
  
                      //ADD TEXT DETILS TO THE LIST
                      excelFileDataList.add(freeTextData);
  
                  }
  
                  //CHECK FOR END OF FILE
                  if(emptyColCount != columnsCount){
                      excelFileRecordsList.add(excelFileDataList);
                  }else{
                      break;
                  }               
              }           
  
          }
          return excelFileRecordsList;
      }
  </code></pre>
  
  <p>Any suggestion is appreciated .</p>