CtExtendedModifiers are stored in a HashSet - leads to non-deterministic pretty-printing
Open
bug
- Dominant language
- Java
- Stars
- 2k
- Forks
- 392
- Avg merge
- 11h 24m
- Merged PRs (30d)
- 36
Description
The `ElementPrinterHelper` prints out modifiers by fetching the extended modifiers. These are in turn stored inside a `HashSet`, which is not ordered. The printer-helper sections them in `[visibility] [abstract/static] [everything else]`, but there is no internal ordering in the `abstract/static` and `everything else` parts.
So, for example, a class with the modifiers `abstract static` could be written either `abstract static` or `static abstract` depending on the machine state. That's not desirable.
Either we store the modifiers in an ordered collection, or the printer helper must order them when printing. Non-deterministic printing is a hassle.
Contributor guide
Assessment
This issue has not been assessed yet.