https://bz.apache.org/bugzilla/show_bug.cgi?id=62551

            Bug ID: 62551
           Summary: The function setSheetname() in the BoundSheetRecord
                    class does not have check on length of sheet name, it
                    throws  java.lang.IllegalArgumentException if sheet
                    name is more than 31.
           Product: POI
           Version: 3.17-FINAL
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: major
          Priority: P2
         Component: HSSF
          Assignee: dev@poi.apache.org
          Reporter: srvnforens...@gmail.com
  Target Milestone: ---

The function setSheetname() in the BoundSheetRecord class does not have check
on length of sheetname, it throws  java.lang.IllegalArgumentException if sheet
name is more than 31.

Test case:-
BoundSheetRecord record = new  
BoundSheetRecord("12345678902234567890323456789011");

Someone has tried to fix the bug for the function setSheetname() in the
XSSFWorkbook class but we can do the same for the BoundSheetRecord class.
like:-

if(sheetname.length() > 31) {
            sheetname = sheetname.substring(0, 31);
        }

Just put the above code before calling the validateSheetName(sheetName) in the
setSheetname() function of the BoundSheetRecord class.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to