exceptionfactory commented on code in PR #9290:
URL: https://github.com/apache/nifi/pull/9290#discussion_r1774127351


##########
nifi-extension-bundles/nifi-poi-bundle/nifi-poi-services/src/main/java/org/apache/nifi/excel/ExcelRecordReader.java:
##########
@@ -45,8 +46,14 @@ public class ExcelRecordReader implements RecordReader {
     private final String dateFormat;
     private final String timeFormat;
     private final String timestampFormat;
+    private final DataFormatter dataFormatter;
 
     public ExcelRecordReader(ExcelRecordReaderConfiguration configuration, 
InputStream inputStream, ComponentLog logger) throws MalformedRecordException {
+        this(configuration, inputStream, logger, null);
+    }
+
+    public ExcelRecordReader(ExcelRecordReaderConfiguration configuration, 
InputStream inputStream, ComponentLog logger, Locale locale) throws 
MalformedRecordException {

Review Comment:
   Instead of adding the new constructor, recommend changing all references to 
the single constructor with the `Locale` required, defaulting to 
`Locale.getDefault()`



##########
nifi-extension-bundles/nifi-poi-bundle/nifi-poi-services/src/main/java/org/apache/nifi/excel/ExcelRecordReader.java:
##########
@@ -127,17 +134,6 @@ private Map<String, Object> getCurrentRowValues(Row 
currentRow, boolean coerceTy
         return currentRowValues;
     }
 
-    private static Object getCellValue(Cell cell) {
-        if (cell != null) {
-            return switch (cell.getCellType()) {
-                case _NONE, BLANK, ERROR, FORMULA, STRING -> 
cell.getStringCellValue();
-                case NUMERIC -> DateUtil.isCellDateFormatted(cell) ? 
cell.getDateCellValue() : cell.getNumericCellValue();
-                case BOOLEAN -> cell.getBooleanCellValue();

Review Comment:
   Does the `DataFormatter` sufficiently handle all of these cases now?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to