Created attachment 21602 [details] Cell G6 contains a simple dropdown. Reading and writing back to a new xls doesn't work in 3.0.2 I'd like to read a simple Excel file containing a dropdown list (data validation) and write it back into a new one. The whole thing worked with POI 3.0.1 but not in with the new POI revision 3.0.2: 1. Read a simple Excel-file with dropdown: InputStream input = MyClass.class.getResourceAsStream( "simple_dropdown.xls" ); POIFSFileSystem fs = new POIFSFileSystem( input ); HSSFWorkbook wb = new HSSFWorkbook(fs); 2. Write the Excel file into another file: FileOutputStream out = new FileOutputStream("output.xls"); wb.write(out); out.close(); Now, here's the thing: - My Excel file only contains a dropdown-list, no further special formatting or other stuff! - If i do the steps above with POI 3.0.1, the dropdown list still exists in the output file - If i do the exact same thing with POI 3.0.2, the dropdown is gone in the output-file. The cell only contains the value which was selected in the input file. The validation rule of the cell is also gone, it is set back to "any value". Am I doing anything wrong? Michael
Created attachment 21606 [details] svn diff of changes to DVALRecord
Created attachment 21607 [details] tar bz2 of one added test class
The problem was due to a combination of in-line field declaration/initialisations, and using the template pattern during instance initialization. It's very easy to miss the fact that the field initialisations run _after_ the super constructor, which called fillFields() on the current class first.
Thanks for the patch Josh, applied to svn
*** Bug 45004 has been marked as a duplicate of this bug. ***
Fix was applied in svn r633151