Groovy
  1. Groovy
  2. GROOVY-3590

Map.get(key, defaultvalue) doesn't work properly if current value is null.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.6.4, 1.7-beta-1
    • Component/s: groovy-jdk
    • Labels:
      None
    • Environment:
      windows xp
      Groovy Version: 1.6.0 JVM: 1.6.0_05

      Description

      I have a Map, args, which contains a key/value pair 'abcd':null .
      I create an default object and then do the get:

      def default_abcd = new abcd(blah, blah)
      args.get('freq',default_freq)

      Now the value of args.abcd is the new object. However, since the key 'abcd' previously existed and had a value (null), the get() call should have left the value alone (as null).

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Roshan Dawrani
            Reporter:
            Paul Czyzewski
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development