Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362984 - Factory methods cannot be declared in abstract classes
Summary: Factory methods cannot be declared in abstract classes
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Rick Barkhouse CLA
QA Contact:
URL: http://stackoverflow.com/questions/80...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-06 06:09 EST by Sergio CLA
Modified: 2022-06-09 10:08 EDT (History)
3 users (show)

See Also:


Attachments
Work in progress (4.40 KB, patch)
2011-11-07 16:57 EST, Rick Barkhouse CLA
no flags Details | Diff
Proposed patch (40.81 KB, patch)
2011-11-08 16:13 EST, Rick Barkhouse CLA
no flags Details | Diff
Patch additions (4.90 KB, patch)
2011-11-09 14:16 EST, Rick Barkhouse CLA
no flags Details | Diff
Patch (44.66 KB, patch)
2011-11-09 15:34 EST, Rick Barkhouse CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio CLA 2011-11-06 06:09:55 EST
When trying to define a static factory method in an abstract class I am obtaining the following exception:

Exception [EclipseLink-171] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The factory class does not define a public default constructor, or the constructor raised an exception.
Internal Exception: java.lang.InstantiationException



More information about the problem here:
http://stackoverflow.com/questions/8022136/static-factory-methods-in-jaxb-moxy
Comment 1 Rick Barkhouse CLA 2011-11-07 16:57:48 EST
Created attachment 206554 [details]
Work in progress
Comment 2 Rick Barkhouse CLA 2011-11-08 16:13:15 EST
Created attachment 206625 [details]
Proposed patch
Comment 3 Rick Barkhouse CLA 2011-11-08 16:33:37 EST
Fixed and checked into trunk.
Comment 4 Rick Barkhouse CLA 2011-11-08 16:34:20 EST
Keeping open until we check into 2.3.2.
Comment 5 Rick Barkhouse CLA 2011-11-09 14:16:12 EST
Created attachment 206728 [details]
Patch additions
Comment 6 Rick Barkhouse CLA 2011-11-09 15:34:40 EST
Created attachment 206736 [details]
Patch
Comment 7 Rick Barkhouse CLA 2011-11-09 15:47:19 EST
Fixed in both trunk and 2.3.
Comment 8 Eclipse Webmaster CLA 2022-06-09 10:08:23 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink