Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346761 - Fails to map arrays of enums
Summary: Fails to map arrays of enums
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-20 15:44 EDT by Markus Heiden CLA
Modified: 2022-06-09 10:23 EDT (History)
2 users (show)

See Also:


Attachments
Proposed changes and test (8.91 KB, patch)
2011-05-25 14:26 EDT, Denise Smith CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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