I want to read the date (yyyy-MM-dd) in Java POI. 

```
Cell cell = cellIterator.next();
cell.setCellType(Cell.CELL_TYPE_STRING);

switch(cell.getCellType()){
    case Cell.CELL_TYPE_STRING:
         if(DateUtil.isCellDateFormatted(cell)){  [ERROR HERE]
              System.out.print(cell.getDateCellValue() + "\t\t");
         }else{
              System.out.print(cell.getStringCellValue() + "\t\t");
         }
    case Cell.CELL_TYPE_NUMERIC:
        System.out.print(cell.getNumericCellValue() + "\t\t");
        break;
    case Cell.CELL_TYPE_BOOLEAN:
        System.out.print(cell.getBooleanCellValue() + "\t\t");
        break;
}

```

However, I get the below error:

```
Exception in thread "main" java.lang.IllegalStateException: Cannot get a numeric value from a text cell
at org.apache.poi.xssf.usermodel.XSSFCell.typeMismatch(XSSFCell.java:882)
at org.apache.poi.xssf.usermodel.XSSFCell.getNumericCellValue(XSSFCell.java:220)
at org.apache.poi.ss.usermodel.DateUtil.isCellDateFormatted(DateUtil.java:495)
at others.ReadDateTime.main(ReadDateTime.java:44)
Java Result: 1

```

How should I corrected it?