JiBX
  1. JiBX
  2. JIBX-76

Collection doesn't allow optional simple java types.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0-RC0
    • Fix Version/s: 1.0-RC2
    • Component/s: core
    • Labels:
      None
    • Environment:
      Suse Linux 9.2, i686
    • Testcase included:
      yes
    • Number of attachments :
      1

      Description

      I need to create a collection of java Object where some are of simple Java types like java.lang.String. I would really like to skip the wrapping patb for it would make my job so much easier. Everything works fine until I mark the value elemnt as optional:
      <value name="string" style="element" type="java.lang.String"/>
      ->
      <value name="string" style="element" type="java.lang.String" usage="optional"/>
      But it must me marked optional for I want an unordered collection.

      The problem is that JiBX binding process gives me an error:
      [bind] Error running binding compiler
      [bind] *** Error during code generation - please report this error on the JiBX users list so that the condition can be caught during validation ***
      [bind] java.lang.IllegalStateException: Internal error: No test for implicit value from collection
      [bind] at org.jibx.binding.def.PropertyDefinition.genTest(PropertyDefinition.java:415)
      [bind] at org.jibx.binding.def.ValueChild.genMarshal(ValueChild.java:527)
      [bind] at org.jibx.binding.def.ValueChild.genContentMarshal(ValueChild.java:687)
      [bind] at org.jibx.binding.def.NestedCollection.genContentMarshal(NestedCollection.java:255)
      ...

      Anyways, I have prepared a simple example with three steps:
      1. The working version that doesn't suite me for there the collection is not unordered.
      2. The example data file demonstrateing why the working case is not enought.
      3. The example of a suitable binding file that gives the exception.

      PS! The exception doesn't occur because of the unordered collection but because of the optional value element.

        Activity

        Hide
        Dennis Sosnoski added a comment -

        Fixed in CVS.

        Show
        Dennis Sosnoski added a comment - Fixed in CVS.

          People

          • Assignee:
            Dennis Sosnoski
            Reporter:
            Kahro Raie
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: