-
Notifications
You must be signed in to change notification settings - Fork 6
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
Copyable plugin does not preserve order of generated code blocks in copyTo() #23
Comments
The problem seemed to appear just recently when updating the JAXB plugins from 2.1 line to 2.2. Kind regards |
Thank you for the suggestion. See dd0c969. |
And see 65ff7eb |
Hi @patrodyne , that was super fast. Do you already have an ETA for the next official release? Kind regards |
Hi,
i'm using your JAXB plugins in generating Java source code from XSD files. I have the following XJC options in place:
-Xannotate -Xfluent-api -Xcopyable
and have the following versions around:org.patrodyne.jvnet:hisrc-basicjaxb-plugins:2.2.1
,org.patrodyne.jvnet:hisrc-hyperjaxb-annox-plugin:2.2.1
Unfortunately the Copyable plugin generates code that does not preserve the order of generated code blocks when it comes to generating the copyTo method. This makes my build non-reproducible for the same inputs.
From a quick look into the Copyable plugin class I can see that method
protected JMethod generateCopyTo$copyTo()
collects the Members to iterate over in a HashMap:Map<FieldOutline, FieldAccessorEx> sourceFieldAccessorMap = new HashMap<>();
After that is just goes through that map and generates the code blocks. I assume that using a
LinkedHashMap
rather thanHashMap
should solve the problem.Kind regards
Henning
The text was updated successfully, but these errors were encountered: