GerardDellemann commented on a change in pull request #234: MM-82 Detect Column Types URL: https://github.com/apache/metamodel/pull/234#discussion_r354288711
########## File path: excel/src/main/java/org/apache/metamodel/excel/ExcelUtils.java ########## @@ -237,13 +292,34 @@ public static String getCellValue(Workbook wb, Cell cell) { return result; } + public static Object getCellValueChecked(final Workbook wb, final Cell cell, final ColumnType expectedColumnType) { + final Object value = getCellValueAsObject(wb, cell); + if (value == null || value.getClass().equals(expectedColumnType.getJavaEquivalentClass())) { + return value; + } + + if (!(value.getClass().equals(Integer.class) && expectedColumnType + .getJavaEquivalentClass() + .equals(Double.class)) && logger.isWarnEnabled()) { + // Don't log when a Integer value is in a Double column type + final String cellCoordinate = "(" + cell.getRowIndex() + "," + cell.getColumnIndex() + ")"; Review comment: done ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services