JiBX
  1. JiBX
  2. JIBX-223

Mapping of 0/1 values to Boolean produces unexpected results

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JiBX 1.1.5
    • Fix Version/s: JiBX 1.2
    • Component/s: core
    • Labels:
      None
    • Environment:
      Windows XP, JIBX 1.1.5 and JIBX 1.1.6a
    • Number of attachments :
      0

      Description

      In XML a •boolean• can have the following legal
      literals

      {true, false, 1, 0}

      . However, when mapping 1
      to a Boolean (the object), I expect the value to be
      true, but the value is actually set to false. After
      debugging through the method calls, it appears that
      when using a Boolean, the Boolean constructor is
      called [public Boolean(String s)] and that only
      compares for the strings true/false not 0 and 1.

      This was posted to the newsgroup at: http://www.mail-archive.com/jibx-users@lists.sourceforge.net/msg02973.html We tried running this test on the JIBX 1.1.6a version, and still see the problem

        Activity

        Hide
        Dennis Sosnoski added a comment -

        Fixed this with added Utility.deserializeBoolean(String) and serializeBoolean(Boolean) methods.

        Show
        Dennis Sosnoski added a comment - Fixed this with added Utility.deserializeBoolean(String) and serializeBoolean(Boolean) methods.
        Dennis Sosnoski made changes -
        Field Original Value New Value
        Fix Version/s JiBX 1.2 [ 14415 ]
        Assignee Dennis Sosnoski [ dsosnoski ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Dennis Sosnoski made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Dennis Sosnoski
            Reporter:
            Jennifer Gau
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: