Undefined static inner classes handled differently with MOXy and RI

Let's say I have the following two classes:

package example.model;

public class Model {
    public static class Inner {}

    public Other prop;
}

      

and

package example.model;

public class Other {
    public static class Inner {}

    public String prop;
}

      

and I am creating a JAXB context with JAXBContext.newInstance(example.model.Model.class)

.

With the default JAXB implementation from Java 6, this works without any annotations, and the generated model doesn't mention "internal". with EclipseLink I get a name clash. The two classes are of type XML with uri and the name inner.

I know that fixing the problem fixes at least one of the @XmlTransient inner classes. I would like to know how this distinction relates to the JAXB standard, and I think also if there is another way to make MOXy ignore these classes, as the default JAXB implementation does.

+3
java eclipselink jaxb moxy


source to share


1 answer


This looks like a bug in EclipseLink JAXB (MOXy) . We are currently working on fixing EclipseLink 2.3.3 and 2.4.0 threads. You can track our progress using the following link:

  • https://bugs.eclipse.org/374429

Once a fix is ​​available, you can download the nightly build from the following link:

  • http://www.eclipse.org/eclipselink/downloads/nightly.php


Bypass

As you noted, you can tag a static inner class @XmlTransient

.

package example.model;

public class Model {
    @XmlTransient        
    public static class Inner {}

    public Other prop;
}

      

+2


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics