groovy
  1. groovy
  2. GROOVY-6621

groovy.util.Node#text incorrect when value is a NodeList

    Details

    • Testcase included:
      yes
    • Patch Submitted:
      Yes
    • Number of attachments :
      0

      Description

      When groovy.util.Node#text checks for it's value being an instance of Collection, it only accounts for String children elements, which means the text() values of Node children of a NodeList value will not be part of the result.

      Github PR with test case to follow.

        Activity

        Hide
        Andy Hamilton added a comment -
        Show
        Andy Hamilton added a comment - Github PR: https://github.com/groovy/groovy-core/pull/353
        Hide
        Andy Hamilton added a comment -
        Show
        Andy Hamilton added a comment - Updated Github PR
        Hide
        Paul King added a comment -

        Added, thanks Andy! I will also add a convenience method "localText" or something similar to make getting the non-nested text a little easier.

        Show
        Paul King added a comment - Added, thanks Andy! I will also add a convenience method "localText" or something similar to make getting the non-nested text a little easier.
        Hide
        Paul King added a comment -

        As noted in the PR, this is a very minor breaking change in behavior but the behavior didn't match the javadoc (which described the intended behavior) previously anyway.

        Show
        Paul King added a comment - As noted in the PR, this is a very minor breaking change in behavior but the behavior didn't match the javadoc (which described the intended behavior) previously anyway.

          People

          • Assignee:
            Paul King
            Reporter:
            Andy Hamilton
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: