Project

Profile

Help

Bug #2407

closed

DOM wrapper: NPE accessing an empty text node

Added by Michael Kay almost 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
DOM Interface
Sprint/Milestone:
Start date:
2015-06-21
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.6
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
Platforms:

Description

Reported on saxon-help list.

Caused by: java.lang.NullPointerException: null

    at net.sf.saxon.tree.util.FastStringBuffer.append(FastStringBuffer.java:68) ~[Saxon-HE-9.6.0-6.jar:na]

    at net.sf.saxon.dom.DOMNodeWrapper.expandStringValue(DOMNodeWrapper.java:337) ~[Saxon-HE-9.6.0-6.jar:na]

    at net.sf.saxon.dom.DOMNodeWrapper.getStringValueCS(DOMNodeWrapper.java:283) ~[Saxon-HE-9.6.0-6.jar:na]

    at net.sf.saxon.tree.wrapper.AbstractNodeWrapper.atomize(AbstractNodeWrapper.java:104) ~[Saxon-HE-9.6.0-6.jar:na]
Actions #1

Updated by Michael Kay almost 9 years ago

Further investigation showed that the DOM contained a text node with a null string value, which was there because it was explicitly put there by an XMLStreamWriter application writing to the DOM.

I'm inclined to do nothing. The DOM doesn't do a very good job of ensuring its own integrity under arbitrary programmatic updates, and we can't be expected to cater for all possible garbage when reading the DOM just because there's nothing that stops the garbage being created.

Actions #2

Updated by Michael Kay over 8 years ago

  • Status changed from New to Resolved

I've noticed that on other paths we're careful to check whether node.getNodeValue() returns null, whether or not the documentation says this is possible; so I've added the same check to this path.

Patched on the 9.6 and 9.7 branches.

Actions #3

Updated by O'Neil Delpratt over 8 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version set to 9.6.0.7

Bug fix applied in the Saxon 9.6.0.7 maintenance release.

Actions #4

Updated by O'Neil Delpratt over 8 years ago

  • Applies to branch 9.6 added
  • Fix Committed on Branch 9.6 added
  • Fixed in Maintenance Release 9.6.0.7 added
Actions #5

Updated by O'Neil Delpratt over 8 years ago

  • Sprint/Milestone set to 9.6.0.7

Please register to edit this issue

Also available in: Atom PDF