Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openness propagation incomplete #93

Open
bravehorsie opened this issue Feb 14, 2019 · 0 comments
Open

Openness propagation incomplete #93

bravehorsie opened this issue Feb 14, 2019 · 0 comments

Comments

@bravehorsie
Copy link
Contributor

JAXB-API propagates opennes to implementation module in a way that if a module is open to java.xml.bind it should be also open to an implementation for example com.sun.xml.bind.

Problem arises when classes used as root element properties are from other package than root elements.

package com.foo;
@XmlRootElement
class A {
  @XmlElement
  private B b;
}

package com.bar;
@XmlRootElement
class B {
  @XmlElement
  private String b;
}

If above classes are declared in a module com.app and that module declares openness to java.xml.bind' as suggested by JAXBContext#newInstance` javadoc:

module com.app {
  requires java.xml.bind;
  opens com.foo to java.xml.bind;`
  opens com.bar to java.xml.bind;
}

Then if JAXB is called with JAXBContext.newInstance(A.class);, JAXB API propagates openness of com.foo to com.sun.xml.bind however it doesn't scan classes for JAXB annotations during SPI discovery and so fails to propagate openness for com.bar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant