You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The order of parser.getResultXsdSchemas() is unreliable over different runs and different platforms, which is making some of my code produce output in an unreliable order. This is due to the underlying HashMap of parseElements:
/**
* A {@link List} which contains all the top elements parsed by this class.
*/
public Map<String, List<ReferenceBase>> parseElements = new HashMap<>();
Note that the documentation is also out-of-date. It is not a list.
Expected behavior
I would like to iterate in the same order as the schema files were included, i.e., the main schema file first, followed by its first include (which can include schemas transitively), followed by its second include, etc.
Proposal: change parseElements to a LinkedHashSet, which respects insertion order:
public Map<String, List<ReferenceBase>> parseElements = new LinkedHashMap<>();
I can confirm that this would solve my issue.
Library Version 1.2.17
The text was updated successfully, but these errors were encountered:
Describe the bug
The order of
parser.getResultXsdSchemas()
is unreliable over different runs and different platforms, which is making some of my code produce output in an unreliable order. This is due to the underlyingHashMap
ofparseElements
:Note that the documentation is also out-of-date. It is not a list.
Expected behavior
I would like to iterate in the same order as the schema files were included, i.e., the main schema file first, followed by its first include (which can include schemas transitively), followed by its second include, etc.
Proposal: change
parseElements
to aLinkedHashSet
, which respects insertion order:I can confirm that this would solve my issue.
Library Version
1.2.17
The text was updated successfully, but these errors were encountered: