Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.6
    • Fix Version/s: 1.1.2
    • Component/s: XML
    • Labels:
      None
    • Environment:
      Operating System: Windows 2000
      Platform: PC
    • Bugzilla Id:
      1854
    • Number of attachments :
      2

      Description

      I need to support Java5 Enum without defining a mapping.
      I tried to do this with Descriptors Handlers and it never worked out.

      After a lots of struggle I decided to treat it as a primitive and that was very
      easy todo than.

      I will upload the patch.diff file for CVS. Please integrate this as I need it
      very much.
      Or if you do not like the approach implement the java5 enum support in any way
      you like.

      The approach is very simply. There are 2 isPrimitive methods
      (Introspector,MarshalFramework).
      I intruduced the following check for enum:
      type.getSuperclass().getName().equals("java.lang.Enum")

      On the marshalling point for primitives I do the same check again and if it is
      an enum, I call the 'name' method.

      On the Unmarshalling point I do the same as your EnumFieldHandler, I call the
      valueOf method.

      1. castor_patch.diff
        5 kB
        Michael Kopp
      2. patch.c991.20070526.txt
        3 kB
        Werner Guttmann

        Issue Links

          Activity

          Hide
          Michael Kopp added a comment -

          As 0.9.6 is out I guess development for 0.9.7 is underway.
          Can this patch be applied now to the new branch?

          mike

          Show
          Michael Kopp added a comment - As 0.9.6 is out I guess development for 0.9.7 is underway. Can this patch be applied now to the new branch? mike
          Hide
          Martin Fuchs added a comment -

          While this is not directly related to this enhancement, I put it here since
          it's a quite tiny thing: In class TxSynchronizableImpl there is used a local
          variable called "enum" in function committed(). This should be renamed to
          e.g. "en", to be compatible to Java5. You might consider to include this in the
          patch.

          Show
          Martin Fuchs added a comment - While this is not directly related to this enhancement, I put it here since it's a quite tiny thing: In class TxSynchronizableImpl there is used a local variable called "enum" in function committed(). This should be renamed to e.g. "en", to be compatible to Java5. You might consider to include this in the patch.
          Hide
          Ralf Joachim added a comment -

          We'll take care of Java5 enums with castor-1221

          Show
          Ralf Joachim added a comment - We'll take care of Java5 enums with castor-1221
          Hide
          Werner Guttmann added a comment -

          Rather than creating a new issue, I made up my mind to reopen this one.

          Show
          Werner Guttmann added a comment - Rather than creating a new issue, I made up my mind to reopen this one.
          Hide
          Werner Guttmann added a comment -

          Original patch redone against current SVN trunk, and cleaned up (as parts of this patch have been committed already as part of CASTOR-1221).

          Show
          Werner Guttmann added a comment - Original patch redone against current SVN trunk, and cleaned up (as parts of this patch have been committed already as part of CASTOR-1221 ).

            People

            • Assignee:
              Werner Guttmann
              Reporter:
              Michael Kopp
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: