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

Bug 357006

Summary: OutOfMemoryError when XmlElementDecl has same name and substitutionHeadName
Product: z_Archived Reporter: Paul Fullbright <paul.fullbright>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: david.twelves, martin.grebac
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch - 2.3
none
Patch - 2.4
none
Patch - 2.3
none
Patch - 2.4 none

Description Paul Fullbright CLA 2011-09-07 16:42:10 EDT
(Occurs in head, 9/7/11)

With ObjectFactory method like:

@XmlElementDecl(name = "product", substitutionHeadName = "product")
public JAXBElement<ProductType> createProduct(ProductType value) {
    return new JAXBElement<ProductType>(_Product_QNAME, ProductType.class, null, value);
}

you receive a stack trace like:

java.lang.OutOfMemoryError: Java heap space
	at java.util.Arrays.copyOf(Arrays.java:2760)
	at java.util.Arrays.copyOf(Arrays.java:2734)
	at java.util.ArrayList.ensureCapacity(ArrayList.java:167)
	at java.util.ArrayList.add(ArrayList.java:351)
	at org.eclipse.persistence.jaxb.compiler.ElementDeclaration.addSubstitutableElement(ElementDeclaration.java:108)
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.updateGlobalElements(AnnotationsProcessor.java:3313)
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.postBuildTypeInfo(AnnotationsProcessor.java:595)
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildNewTypeInfo(AnnotationsProcessor.java:4076)
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildTypeInfo(AnnotationsProcessor.java:674)
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.postBuildTypeInfo(AnnotationsProcessor.java:594)

...
Comment 1 Rick Barkhouse CLA 2011-09-22 16:16:07 EDT
Created attachment 203863 [details]
Patch - 2.3
Comment 2 Rick Barkhouse CLA 2011-09-22 16:16:52 EDT
Created attachment 203864 [details]
Patch - 2.4
Comment 3 Rick Barkhouse CLA 2011-09-23 13:39:47 EDT
Created attachment 203923 [details]
Patch - 2.3
Comment 4 Rick Barkhouse CLA 2011-09-23 13:40:05 EDT
Created attachment 203924 [details]
Patch - 2.4
Comment 5 Rick Barkhouse CLA 2011-09-23 13:48:36 EDT
Fixed, reviewed by dmahar.
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:14:27 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 7 Eclipse Webmaster CLA 2022-06-09 10:36:04 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink