When reading XLSX files with data validations. DataValidation.getErrorStyle() always returns 1 (warning) DataValidation.getEmptyCellAllowed() always returns true. Checked in 3.7 and 3.9 for XSSFSheet.
Any chance you could produce a short unit test that shows the problem? For example, a small file with a few different validations in it, some valid and some not, along with a short bit of POI code that tries to read and assert them?
No response for a long time, therefore closing this as WONTFIX as we do not have a file/unit test which reproduces the issue. Please reopen this bug with more information if you still see this problem with a more recent version of POI.
Created attachment 35696 [details] Code and Example XLSX
I can confirm the problem with the errorStyle. I you have a data validation with errorStyle = STOP, then DataValidation.getErrorStyle() will return WARNING. I added an example and junit test showing the problem. I looked into the .xslx file internals and noticed that Excel does not save the errorStyle attribute in the XML schema if the errorStyle equals STOP. So it seems that the default value for errorStyle is wrong. DataValidation.getEmptyCellAllowed() seems to work fine for me. I think the problem is the name which is quite missleading compared to the Excel UI. At least in the German Excel the attribute "emptyCellAllowed = true" equals to the option "ignore empty cells". I think this is because the Excel UI wants to tell me something like "we won't check empty cells" but the implementation defines it like "empty cells are always valid".
Fix from https://github.com/apache/poi/pull/95 was merged - https://svn.apache.org/viewvc?view=revision&revision=1822719
*** Bug 60870 has been marked as a duplicate of this bug. ***