Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1407

GPath expression on Map.entrySet() expanding out too much

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-JSR-6
    • 1.5
    • None
    • None
    • WinXP (prof edn), Java jre1.5.0_07

    Description

      When using GPath expression with a complexly-keyed and -valued map, it expands out too much. An example:

      m= [ ['a','b']:[2,34], ['c','d']:[2,16], ['e','f']:[3,97], ['g','h']:[4,48] ]
      println m.entrySet().key //prints [a, b, g, h, e, f, c, d] instead of [[a, b], [g, h], [e, f], [c, d]]
      println m.entrySet().value //prints [2, 34, 4, 48, 3, 97, 2, 16] instead of [[2, 34], [4, 48], [3, 97], [2, 16]]

      Is this a bug or intended?

      Note:
      println m.entrySet() //prints [[a, b]=[2, 34], [g, h]=[4, 48], [e, f]=[3, 97], [c, d]=[2, 16]] which is OK

      Attachments

        Activity

          People

            Unassigned Unassigned
            gavingrover Gavin Grover
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: