Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 346761

Summary: Fails to map arrays of enums
Product: z_Archived Reporter: Markus Heiden <markus>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: denise.mahar, eclipselink.oxm-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Proposed changes and test none

Description Markus Heiden CLA 2011-05-20 15:44:08 EDT
Build Identifier: 2.3.0.v20110516-r9382

When I try to map a field per @XmlElement which is an array of an enum type (CodeType) like:

public class CommandBuffer {
  @XmlElement
  private final CodeType[] types;
  ...
}

MOXy fails with

Exception [EclipseLink-110] (Eclipse Persistence Services - 2.3.0.v20110516-r9382): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: Descriptor is missing for class [[...].CodeType].
Mapping: org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping[types]
Descriptor: XMLDescriptor([...].CommandBuffer --> [])

When I change the type to list of the same enum type, like:

  @XmlElement
  private final List<CodeType> types;

everything works like expected.

Reproducible: Always

Steps to Reproduce:
See Details
Comment 1 Denise Smith CLA 2011-05-25 14:26:29 EDT
Created attachment 196588 [details]
Proposed changes and test
Comment 2 Denise Smith CLA 2011-05-25 14:50:44 EDT
We were missing a check to handle enum types in the place where we deal with arrays.  Fixed (patch and new test attached).
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:15:41 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:23:25 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink