Bug 55923 - [PATCH] Xml data export leads to a NPE when sorting output data
Summary: [PATCH] Xml data export leads to a NPE when sorting output data
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.9-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-23 10:22 UTC by Marc
Modified: 2014-02-03 20:57 UTC (History)
0 users



Attachments
[PATCH] fixes the mentioned problem (9.26 KB, patch)
2013-12-23 11:37 UTC, Marc
Details | Diff
[PATCH] fixes the mentioned problem (9.26 KB, patch)
2013-12-23 11:47 UTC, Marc
Details | Diff
[PATCH] fixes the mentioned problem (9.26 KB, application/octet-stream)
2013-12-23 11:51 UTC, Marc
Details
[PATCH] fixes the mentioned problem (8.36 KB, application/octet-stream)
2013-12-23 13:48 UTC, Marc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc 2013-12-23 10:22:46 UTC
The class XSSFExportToXml fails when comparing two similiar xPaths. It continous comparing the xPath nodes after the last common node which then leads to a null pointer exception.

Example
-----------

Given to xPaths:

1. A/B/C/E
2. A/B/D/E

Expected behaviour: Iterating up to node B. Testing if C or D appears first in the schema xml.

Actual beahviour: It continous comparing node E after node C/D whichs then leads to a NPE.

I'm going to provide a patch for this issue.
Comment 1 Marc 2013-12-23 11:37:49 UTC
Created attachment 31141 [details]
[PATCH] fixes the mentioned problem

including an unit test
Comment 2 Marc 2013-12-23 11:47:48 UTC
Created attachment 31142 [details]
[PATCH] fixes the mentioned problem

- I had to submit the patch again, because bugzilla didn't detected the file type correctly
- Patch includes an unit test which proves the problem
Comment 3 Marc 2013-12-23 11:51:47 UTC
Created attachment 31143 [details]
[PATCH] fixes the mentioned problem
Comment 4 Marc 2013-12-23 13:48:22 UTC
Created attachment 31144 [details]
[PATCH] fixes the mentioned problem

- Renamed the excel test file to match bugzilla number (55923)
Comment 5 Dominik Stadler 2014-02-03 20:57:34 UTC
This is now also applied to trunk (post 3.10!) via r1564050, thanks again for all the nicely built patches.