Tykhon Korol created CXF-9201:
---------------------------------

             Summary: Unexpected enum name generation when using 
typesafeEnumMemberName="generateName" together with 
underscoreBinding="asCharInWord" since CXF 4.1.4
                 Key: CXF-9201
                 URL: https://issues.apache.org/jira/browse/CXF-9201
             Project: CXF
          Issue Type: Bug
          Components: Core, JAXB Databinding
    Affects Versions: 4.1.5, 4.1.4
            Reporter: Tykhon Korol


We observed an unexpected behavior when generating Java classes from a WSDL 
using JAXB binding customization.

A specific combination of two parameters in the JAXB binding file causes 
incorrect enum name generation:
 * {{typesafeEnumMemberName="generateName"}}

 * {{underscoreBinding="asCharInWord"}}

When both parameters are set, the generated enum constant names are not created 
in the expected format {{VALUE_<N>}} (where {{<N>}} is the enum index).
Instead, they are generated as {{{}__<N>{}}}.

*Expected behavior*

Enum constants should be generated as:
VALUE_1
VALUE_2
VALUE_3
...
*Actual behavior*

Enum constants are generated as:
__1
__2
__3
...
 
*Versions tested*
 * The issue *does not occur* in Apache CXF *4.1.3*

 * The issue *occurs starting from version 4.1.4*

*Additional investigation*

We also verified whether the issue might be related to Jakarta XML Binding 
({{{}jakarta.xml.bind{}}}).
Testing with an older version of the library did *not* change the behavior.

*Steps to reproduce*
 # Use CXF version *4.1.4 or newer*

 # Use a JAXB binding file containing:

<jaxb:globalBindings 
typesafeEnumMemberName="generateName"
underscoreBinding="asCharInWord"/> # Generate Java classes from a WSDL that 
contains enums with values that require generated names.

*Result:*
Enum constants are generated as {{__<N>}} instead of {{VALUE_<N>}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to