Commons JXPath
  1. Commons JXPath
  2. JXPATH-51

second call to hasNext() on DOM Iterator causes NPE

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0 Final
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: Linux
      Platform: PC

      Description

      A second call to an empty DOM Iterator causes a NullPointerException in
      DOMNodeIterator. The attached patch to DOMModelTest tests for and illustrates
      the problem.

        Activity

        Hide
        Ross Gardler added a comment -

        Created an attachment (id=3476)
        Test for NPE on second hasNext() call

        Show
        Ross Gardler added a comment - Created an attachment (id=3476) Test for NPE on second hasNext() call
        Hide
        Ross Gardler added a comment -

        Created an attachment (id=3477)
        Provides a simplistic fix for this bug - pretty sure it can be improved on

        Show
        Ross Gardler added a comment - Created an attachment (id=3477) Provides a simplistic fix for this bug - pretty sure it can be improved on
        Hide
        Dmitri Plotnikov added a comment -

        Rewrote the logic of hasNext() and next() on EvalContext. Multiple calls to
        hasNext are now allowed

        Show
        Dmitri Plotnikov added a comment - Rewrote the logic of hasNext() and next() on EvalContext. Multiple calls to hasNext are now allowed

          People

          • Assignee:
            Unassigned
            Reporter:
            Ross Gardler
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development