#516 XPathEvaluator.reset() throws NPE

v8.7.1
closed
nobody
5
2012-10-08
2006-05-04
No

Calling XPathEvaluator.reset() leads to a
NullPointerException. It is fairly obvious why the NPE
is being thrown. It looks as if either config should
not be set to null (if config does not keep state) or
the portions of the config that keeps state should be
reset or a brand new config should be created.

The work-around is to create a new XPathEvaluator
everytime.

java.lang.NullPointerException
at
net.sf.saxon.xpath.StandaloneContext.<init>(StandaloneContext.java:68)
at
net.sf.saxon.xpath.XPathEvaluator.reset(XPathEvaluator.java:217)

Discussion

  • Michael Kay
    Michael Kay
    2006-05-10

    Logged In: YES
    user_id=251681

    Thanks for reporting this (but I'd be grateful if you follow
    the protocol in future of reporting incidents first on the
    saxon-help list or forum (or on support requests). One
    reason is so that all the bugs here are confirmed with
    precise information about the cause and cure, another is
    simply that I don;t get notified of new entries in the
    "bugs" section unless the originator explicitly assigns it
    to me!

    I'm going to fix this by deleting the line

    config = null

    on line 214. This means that the same Configuration will
    continue to be used. I think this is probably what comes
    closest to the intent of the JAXP specification in terms of
    reusing resources.