You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2019/05/04 16:46:40 UTC

[Bug 63401] New: XSSFTable.getName throws an error if called before calling setName

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

            Bug ID: 63401
           Summary: XSSFTable.getName throws an error if called before
                    calling setName
           Product: POI
           Version: 4.0.x-dev
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: dmgauntt@uab.edu
  Target Milestone: ---

If an XSSFTable is created, and getName is called before setName is called,
then getName throws an IndexOutOfBounds error.  The simplest way to prevent
this is to call setName inside createTable; I will post a patch and a test case
shortly.

Stack trace:

java.lang.IndexOutOfBoundsException
        at org.apache.xmlbeans.impl.store.Xobj.remove_attribute(Xobj.java:2287)
        at
org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTTableImpl.unsetName(Unknown
Source)
        at org.apache.poi.xssf.usermodel.XSSFTable.setName(XSSFTable.java:395)
        at org.apache.poi.xssf.usermodel.XSSFTable.getName(XSSFTable.java:384)

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


[Bug 63401] XSSFTable.getName throws an error if called before calling setName

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63401

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #3 from Dominik Stadler <do...@gmx.at> ---
Applied via r1861819 in a slightly different way, some more minor modifications
may be pending via bug 63400 and 62906.

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


[Bug 63401] XSSFTable.getName throws an error if called before calling setName

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63401

--- Comment #1 from David Gauntt <dm...@uab.edu> ---
Created attachment 36563
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36563&action=edit
JUnit Test case to illustrate bug 63401

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


[Bug 63401] XSSFTable.getName throws an error if called before calling setName

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63401

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

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


[Bug 63401] XSSFTable.getName throws an error if called before calling setName

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63401

--- Comment #2 from David Gauntt <dm...@uab.edu> ---
Created attachment 36564
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36564&action=edit
Patch to XSSFSheet.createTable

This is similar to the patch to bug 62906 and enhancement 63400, but with a
comment added before the line that fixes bug 63401.

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