0

I want change these deprecated method:

    if (sheet.getRow(1).getCell(1).getCellType() == XSSFCell.CELL_TYPE_BLANK) {
        testSuite = "";
    } else if (sheet.getRow(1).getCell(1).getCellType() == XSSFCell.CELL_TYPE_NUMERIC) {
        double password1 = sheet.getRow(1).getCell(1).getNumericCellValue();
        testSuite = String.valueOf(password1);
    } else if (sheet.getRow(1).getCell(1).getCellType() == XSSFCell.CELL_TYPE_STRING) {
        testSuite = sheet.getRow(1).getCell(1).getStringCellValue();
    } else if (sheet.getRow(1).getCell(1).getCellType() == XSSFCell.CELL_TYPE_FORMULA) {
        testSuite = sheet.getRow(1).getCell(1).getStringCellValue();
    }

enter image description here I see inside source:

/**
 * Return the cell type.
 * 
 * Will return {@link CellType} in a future version of POI.
 * For forwards compatibility, do not hard-code cell type literals in your code.
 *
 * @return the cell type
 * @deprecated 3.15. Will return a {@link CellType} enum in the future.
 */
@Override
public int getCellType() {
    return getCellTypeEnum().getCode();
}
Vy Do
  • 46,709
  • 59
  • 215
  • 313

0 Answers0