-
Notifications
You must be signed in to change notification settings - Fork 114
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
Problems with episodal compilation and (most likely, the solution for #1356) #1735
Comments
Here's a small example to demonstrate multiple generation of IllegalAnnotationsException
For example, this first schema defines an element a.xsd
This second schema imports the first schema and defines element b.xsd
The XJC tool is used to generate Java classes for from the first schema and an JAXB episode file. Then it is used to bind the second schema to the episode file to generate the second set of Java classes, episodically. *xjc-run.sh
The resulting layout is: Example
Using
|
I'm migrating to jakarta with many of our projects relying on opengis (gml, observation and measurements, sensorweb enablement). After the migration I'm having problems when running my webservices and unit test:
Closer inspection revealed an extra attribute was generated. I wrote an SO issue on that here.
It took me some time to reproduce the issue, since more behavior as changed. Especially around the
mixed = true
behaviour (no content getter seems to be generated and the java inheritance changed for 'Values`).Here you can find my reproducer.
Another branch shows that problem of the 'mixed = true' behavior and inheritance of 'Values' that does no longer extend
EncodedValuesPropertyType
.I'm going to push my analysis a bit further into why my production code shows the problem with the 'mixed = true' present, so why it deviates from my reproducer.
I use episodal compilation to layer the structure and write common code on the common treats. This is a large product with 20+ datatypes relying on the opengis stack. For more info see: https://schema.broservices.nl/xsd/ . I've no opportunity to change the XSD.
EDIT
I found out why the
mixed=true
addition caused the issue. The original SWE library has been downsized to exactly the types required in all our datatypes to relief problems that many parties had connecting to our systems. In that process,mixed = true
has been added. Check here for the original and here for the profile.By changing the SWECommon to the profile (used in our production environments) I was able to reproduce the problem I have in migrating to Jakarta. Check here.
It's in the end related to this piece of generated java code:
That brings me back to #1356. The fix in 2019 seems to be in this particular area. My suspicion is that generating Java code in one project with this scenario is covered, but the solution does not take into consideration episodal compilation.
Class:
com.sun.tools.xjc.model.CClassInfo
Please note that there are more problems encountered in the past with episodal compilation. One of them is already 'fixed' in the provided binding for SWECommon: moving a generated base method 'out of the way' to avoid a 'clash' with the overidden one.
EDIT 2It is still not reproducing the problem I'm having. I missed to comment inmixed = true
in my second branch (.. Doing that changes the generated code back from:toUnlike my production code which hasmixed = true
in both the inherited - and the base class.. So still not precisely matching my own case. Must be something else at play. But perhaps my problem is already clear. Will keep on trying to find an exact reproducer.problem is now truly reproduced. Proper schema import changed for reproducer.
The text was updated successfully, but these errors were encountered: