The Sheet.getColumnWidth and Sheet.setColumnWidth if test within the for loop is not right so when the column lies within a columninfo range it doesnt return the correct columninfo object Patch which corrects will be supplied immediately. Patch to the unit tests to follow, so that the problem doesnt happen again.
Created attachment 2390 [details] Patch to Sheet.java
Created attachment 2393 [details] TestHSSFSheet patch for column width test. Please commit both patches
After applying, here's what I get when doing ./build.sh clean compile test please fix and reopen/attach and/or let me know what I'm doing wrong Thanks! -> Compiling project examples with Java 1.3, debug on, optimize off, deprecation on Compiling project contributions with Java 1.3, debug on, optimize off, deprecati on on test: Created dir: D:\andy\homestuff\jakarta-poi2\2\jakarta-poi\build\testcases Compiling 103 source files to D:\andy\homestuff\jakarta-poi2\2\jakarta-poi\build \testcases D:\andy\homestuff\jakarta-poi2\2\jakarta-poi\src\testcases\org\apache\poi\hssf\u sermodel\TestHSSFSheet.java:206: getColumnWidth(short) in org.apache.poi.hssf.us ermodel.HSSFSheet cannot be applied to (int) assertEquals(sheet.getDefaultColumnWidth(), sheet.getColumnWidth(0)); ^ D:\andy\homestuff\jakarta-poi2\2\jakarta-poi\src\testcases\org\apache\poi\hssf\u sermodel\TestHSSFSheet.java:207: setColumnWidth(short,short) in org.apache.poi.h ssf.usermodel.HSSFSheet cannot be applied to (int,int) sheet.setColumnWidth(0, 9000); ^ D:\andy\homestuff\jakarta-poi2\2\jakarta-poi\src\testcases\org\apache\poi\hssf\u sermodel\TestHSSFSheet.java:208: getColumnWidth(short) in org.apache.poi.hssf.us ermodel.HSSFSheet cannot be applied to (int) assertEquals(9000, sheet.getColumnWidth(0)); ^ D:\andy\homestuff\jakarta-poi2\2\jakarta-poi\src\testcases\org\apache\poi\hssf\u sermodel\TestHSSFSheet.java:209: setColumnWidth(short,short) in org.apache.poi.h ssf.usermodel.HSSFSheet cannot be applied to (int,int) sheet.setColumnWidth(2, 8000); ^ D:\andy\homestuff\jakarta-poi2\2\jakarta-poi\src\testcases\org\apache\poi\hssf\u sermodel\TestHSSFSheet.java:210: getColumnWidth(short) in org.apache.poi.hssf.us ermodel.HSSFSheet cannot be applied to (int) assertEquals(8000, sheet.getColumnWidth(2)); ^ 5 errors BUILD FAILED D:\andy\homestuff\jakarta-poi2\2\jakarta-poi\tools\cents\junit.cent\xbuild.xml:2 7: Compile failed; see the compiler error output for details. Total time: 1 minute 37 seconds
I fixed ti
Applied, please cross check. In the future please make sure you run "./build.sh clean compile test" before submitting the patches. Thanks for your patch!
*** Bug 8906 has been marked as a duplicate of this bug. ***