This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 372404 - Add support for Sun JAXB's CycleRecoverable functionality
Summary: Add support for Sun JAXB's CycleRecoverable functionality
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Rick Barkhouse CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 359251
  Show dependency tree
 
Reported: 2012-02-23 15:30 EST by Rick Barkhouse CLA
Modified: 2022-06-09 10:05 EDT (History)
1 user (show)

See Also:


Attachments
Patch - code changes (14.09 KB, patch)
2012-04-20 15:47 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - code changes (14.10 KB, patch)
2012-04-20 15:56 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - code changes (14.09 KB, patch)
2012-04-20 16:06 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - code changes (13.43 KB, patch)
2012-04-23 09:45 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - code changes (16.36 KB, patch)
2012-04-23 10:46 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - Code changes (trunk) (41.16 KB, patch)
2012-04-23 15:34 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - Test changes (trunk) (17.18 KB, patch)
2012-04-23 15:35 EDT, Rick Barkhouse CLA
no flags Details | Diff
WIP (60.36 KB, patch)
2012-04-23 16:56 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - code changes (24.02 KB, patch)
2012-04-26 13:25 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - test changes (19.69 KB, patch)
2012-04-26 13:26 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - code changes (23.74 KB, patch)
2012-04-26 13:55 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - code changes (23.13 KB, patch)
2012-04-26 14:37 EDT, 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 Rick Barkhouse CLA 2012-02-23 15:30:52 EST
Provide equivalent functionality to Sun's CycleRecoverable in MOXy.

See:
http://jaxb.java.net/guide/Mapping_cyclic_references_to_XML.html
http://www.java.net/node/654639
Comment 1 Rick Barkhouse CLA 2012-04-16 15:34:45 EDT
The following class demonstrates how this is used in the RI:

//========================

package cyclerecovery;

import javax.xml.bind.annotation.XmlRootElement;

import com.sun.xml.bind.CycleRecoverable;

@XmlRootElement
public class Data implements CycleRecoverable {

    public String key;

    public Data parentData;
    public Data childData;
    
    @Override
    public Data onCycleDetected(Context context) {
        System.err.println("CYCLE DETECTED");
        Data d = new Data();
        d.key = "cycle-buster";
        return d;
    }
	
}

//========================

...
        Data d1 = new Data();
        d1.key = "parent";
        Data d2 = new Data();
        d2.key = "child";
        d1.childData = d2;
        d2.parentData = d1;
        m.marshal(d1, System.out);
...

//========================

Note that in the RI, the com.sun.xml.bind.CycleRecoverable interface works, but the com.sun.xml.internal.bind.CycleRecoverable does not.
Comment 2 Rick Barkhouse CLA 2012-04-20 15:47:15 EDT
Created attachment 214325 [details]
Patch - code changes
Comment 3 Rick Barkhouse CLA 2012-04-20 15:56:23 EDT
Created attachment 214327 [details]
Patch - code changes
Comment 4 Rick Barkhouse CLA 2012-04-20 16:06:01 EDT
Created attachment 214329 [details]
Patch - code changes
Comment 5 Rick Barkhouse CLA 2012-04-23 09:45:38 EDT
Created attachment 214388 [details]
Patch - code changes
Comment 6 Rick Barkhouse CLA 2012-04-23 10:46:06 EDT
Created attachment 214398 [details]
Patch - code changes
Comment 7 Rick Barkhouse CLA 2012-04-23 15:34:49 EDT
Created attachment 214416 [details]
Patch - Code changes (trunk)
Comment 8 Rick Barkhouse CLA 2012-04-23 15:35:13 EDT
Created attachment 214417 [details]
Patch - Test changes (trunk)
Comment 9 Rick Barkhouse CLA 2012-04-23 16:56:32 EDT
Created attachment 214424 [details]
WIP
Comment 10 Rick Barkhouse CLA 2012-04-26 13:25:47 EDT
Created attachment 214618 [details]
Patch - code changes
Comment 11 Rick Barkhouse CLA 2012-04-26 13:26:14 EDT
Created attachment 214619 [details]
Patch - test changes
Comment 12 Rick Barkhouse CLA 2012-04-26 13:55:08 EDT
Created attachment 214621 [details]
Patch - code changes
Comment 13 Rick Barkhouse CLA 2012-04-26 14:37:35 EDT
Created attachment 214626 [details]
Patch - code changes
Comment 14 Rick Barkhouse CLA 2012-04-26 16:16:53 EDT
Completed and checked into trunk (2.4.0).  Reviewed by bdoughan.
Comment 15 Eclipse Webmaster CLA 2022-06-09 10:05:19 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink