The code should be looking for the first element, not first node. Alternately the DOM parser can be configured to ignore comments.
— Jacob Barrett Manager GemFire Advanced Customer Engineering (ACE) Pivotal [email protected] 503-533-3763 For immediate support please contact Pivotal Support at http://support.pivotal.io/ On Mon, Dec 7, 2015 at 2:34 PM, Dan Smith <[email protected]> wrote: >> 2) Is the code above correct? >> > So, the NPE is because doc.getFirstChild() will return the comment. > It looks like this code is used within the context of extracting elements > from an xml file we generate. So with the current geode code it will never > see a comment, but it might still be worth just fixing the code to be more > flexible. We do allow xml generating extensions to be registered, so this > code could potentially cause NPEs if an extension generates xml with a > comment. > -Dan
