Preliminary note: This bug is in 3.1-FINAL, but the latest version the Combo Box did offer was 3.0-dev In HSSFSheet.autoSizeColumns(), the following code: if (width != -1) { if (width > Short.MAX_VALUE) { //width can be bigger that Short.MAX_VALUE! width = Short.MAX_VALUE; } sheet.setColumnWidth(column, (short) (width * 256)); } should be replaced by: if (width != -1) { width *= 256; if (width > Short.MAX_VALUE) { //width can be bigger that Short.MAX_VALUE! width = Short.MAX_VALUE; } sheet.setColumnWidth(column, (short) (width)); } which is probably what was intended, since only then the cast to short will always have an argument that is within range. With the original version, large widths produce settings which depend on the least significant bits and thus tend to be rather random. The topic has already be addressed in bug #43090, but the resolution which made it into the final version does not solve the problem.
Thanks for pointing it out. Of course, multiplication should be done before checking Short.MAX_VALUE. Fixed in r686844. Yegor