Jackson JSON Processor
  1. Jackson JSON Processor
  2. JACKSON-823

MissingNode returns 0 for as-number methods that take a default.

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.6
    • Fix Version/s: 1.9.7
    • Component/s: JSON tree (JsonNode)
    • Labels:
      None
    • Number of attachments :
      1

      Description

      The implementation of MissingNode returns 0 for calls like "asInt(4)", but I would expect the passed-in default value to be returned instead. This would remove another layer of if checking.

      Attached is an example; I would expect val to be 4. Output is:

      Hello
      Missing: true
      Value was: 0

      1. tree.java
        0.6 kB
        Adam Vandenberg

        Activity

        Hide
        Tatu Saloranta added a comment -

        Fixed for 1.9.7; verified for 2.0.x (where it was working or already fixed)

        Show
        Tatu Saloranta added a comment - Fixed for 1.9.7; verified for 2.0.x (where it was working or already fixed)

          People

          • Assignee:
            Tatu Saloranta
            Reporter:
            Adam Vandenberg
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: