fix: enforce JAXB field order in Project with @XmlType(propOrder) #100
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose of this PR
This PR addresses an issue discovered during Nondex testing. Nondex is a tool that repeatedly runs JUnit tests with different thread schedules to detect nondeterministic behavior in concurrent or order-sensitive code. The original
Projectclass did not specify a fixed order for JAXB-serialized fields, and so fields such asscenes,structure,application,transport, andarrangementwere marshaled in an undefined order, which could vary between runs. Nondex detected that theDawProject.validatetests sometimes failed because XML validation against the schema depended on the order of elements, making the test non-deterministic.Changes Made:
@XmlType(propOrder = {"scenes", "structure", "application", "transport", "arrangement"})to theProjectclass.Results:
Steps to reproduce
pluginsinbuild.gradle:id 'edu.illinois.nondex' version '2.2.1'build.gradle:apply plugin: 'edu.illinois.nondex'dependenciesinbuild.gradle:./gradlew nondexTest --tests "com.bitwig.dawproject.DawProjectTest.createAudioExample",./gradlew nondexTest --tests "com.bitwig.dawproject.DawProjectTest.createMIDIAutomationInClipsExample",./gradlew nondexTest --tests "com.bitwig.dawproject.DawProjectTest.validateComplexDawProject",and
./gradlew nondexTest --tests "com.bitwig.dawproject.DawProjectTest.validateDawProject",and you should see output similar to below:
or
or