Vineflower / vineflower

Modern Java decompiler aiming to be as accurate as possible, with an emphasis on output quality. Fork of the Fernflower decompiler.
https://vineflower.org/
Apache License 2.0
1.13k stars 83 forks source link

Fix for `null, default` switch case not being last #390

Closed jpenilla closed 1 month ago

jpenilla commented 1 month ago

In some cases after different processing stages, the default case is no longer last. This reorders it to last if necessary after all other switch processing.

A better solution may be to use the last instead of the first index when merging edges, this would likely improve the accuracy of TestAssignmentSwitchExpression3 output (as in case order matching input source).

jaskarth commented 1 month ago

Closing this one since I merged the other one instead. But thanks a lot for looking into this issue!