The following issue has been updated:

    Updater: Dennis Sosnoski (mailto:[EMAIL PROTECTED])
       Date: Thu, 27 May 2004 3:59 PM
    Comment:
As discussed on the mailing list, this is not a bug but rather a feature issue. JiBX 
currently treats char primitives as 16-bit unsigned integers because they're often 
used in that way by data-oriented applications. It's already easy enough to change 
this behavior, just by using a simple custom <format>. I'll at least make it easier by 
including the serializer/deserializer implementation in the Utility class, and perhaps 
make this the default.
    Changes:
             assignee changed to Dennis Sosnoski
             type changed from Bug to Improvement
             priority changed from Major to Minor
             timeoriginalestimate changed from 300
             timeestimate changed from 5 minutes
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://jira.codehaus.org/browse/JIBX-21?page=history

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/JIBX-21

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JIBX-21
    Summary: JiBX won't (un)marshal single characters
       Type: Improvement

     Status: Open
   Priority: Minor

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: JiBX
 Components: 
             core
   Versions:
             1.0-beta3b

   Assignee: Dennis Sosnoski
   Reporter: Thomas Jones-Low

    Created: Wed, 19 May 2004 1:53 PM
    Updated: Thu, 27 May 2004 3:59 PM

Description:
JiBX refuses to (un)marshal single character values. The JiBX runtime utility insists 
upon improperly treating characters unsigned integers.

test case: 

<binding>
  <mapping name="testcase" class="TestCase">
     <value name="name" field="name">
     <value name="yesno" field="yesno">
   </mapping>
</binding>

public class TestCase
{
    String name;
    char yesno;
}

<testcase>
  <name>test name</name>
  <yesno>Y</name>
</testcase>



   The fix to this issue is to update the two functions in the runtime utility module: 

    public static char parseChar(String text) throws JiBXException {
        if (text.length() != 1) 
            throw new JiBXException ("Value out of range");
        return text.charAt(0);
    }

    public static String serializeChar(char value) {
        return Character.toString(value);
    }



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
jibx-devs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to