getXNoTransform(int i) for List child

Issue #254 resolved
Jesper Mattsson created an issue

For a list child X*, the traversal method for getting a single member of the list does not have a NoTransform version, i.e. getXNoTransform(int i).

While getListXNoTransform().getChildNoTransform(i) can be used, it uses the low-level API and is not obvious.

Comments (4)

  1. Jesper Mattsson reporter

    What will this implementation do if the NTA isn't evaluated yet? To me it looks like it will give null pointer expression. I'd expect it to generate the list it it is not yet generated, but not trigger any rewrites on the children of the list.

  2. Jesper Öqvist

    What will this implementation do if the NTA isn't evaluated yet? To me it looks like it will give null pointer expression. I'd expect it to generate the list it it is not yet generated, but not trigger any rewrites on the children of the list.

    Good question. I had not considered NTA list components. I have added a new test which checks this case to the test suite and fixed the issue.

  3. Jesper Öqvist

    Handle NTA list components in getXNoTransform(int)

    The getXNoTransform(int) method is generated differently if the list component is an NTA to avoid causing a null pointer exception by accessing the uninitialized NTA value.

    see #254 (bitbucket)

    → <<cset dbad0e928761>>

  4. Log in to comment