[Bug 64721] New: NullPointerException occurs when calling getDataSize() of an object created with ExtRst.copy()

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 64721] New: NullPointerException occurs when calling getDataSize() of an object created with ExtRst.copy()

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64721

            Bug ID: 64721
           Summary: NullPointerException occurs when calling getDataSize()
                    of an object created with ExtRst.copy()
           Product: POI
           Version: 4.1.2-FINAL
          Hardware: PC
            Status: NEW
          Severity: critical
          Priority: P2
         Component: HSSF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

Class: org.apache.poi.hssf.record.common.ExtRst
Method: getDataSize()

Null Pointer Property: extraData

I am developing excel export function using Jxls 2.8.1 and jxls-poi 2.8.1, poi
4.1.2 version.

The export function for xlsx was created first and is working fine.

During testing because the export function for xls was also needed, I found
that a NullPointerException occurred during the write process.

As a result of tracking the location of the error using the Debugger, when
executing ExtRst.getDataSize(), a NullPointerException occurred in the
extraData.length part and reported.

This error is caused by leaving extraData null in ExtRst.copy() which is called
when org.apache.poi.hssf.record.common.UnicodeString.copy() is called.

I can't afford to wait for the patch to complete, so I'm going to use version
4.1.1 without the ExtRst class.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64721] NullPointerException occurs when calling getDataSize() of an object created with ExtRst.copy()

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64721

Kwon Ohyoung <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|PC                          |All
                 OS|                            |All

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64721] NullPointerException occurs when calling getDataSize() of an object created with ExtRst.copy()

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64721

Kwon Ohyoung <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #1 from Kwon Ohyoung <[hidden email]> ---
Created attachment 37437
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37437&action=edit
Patch for this error

As a result of checking the version 4.1.1 and below, I confirmed that ExtRst
exists as an inner class of UnicodeString, but there is no same problem.

In the process of separating ExtRst into an independent class and replacing
clone() with copy(), the process of initializing populateEmpty() seems to be
missing.

Uploaded Patch: (from: /tags/REL_4_1_2)
   -Modify to call this() in copy constructor ExtRst(ExtRst other)
   -Add test case to detect this NullPointerException case

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64721] NullPointerException occurs when calling getDataSize() of an object created with ExtRst.copy()

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64721

PJ Fanning <[hidden email]> changed:

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

--- Comment #2 from PJ Fanning <[hidden email]> ---
thanks - merged with
https://github.com/apache/poi/commit/6c7bf59087e720a663fc5aec7ec5b2d502d7accd

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]