leibnitz27 / cfr

This is the public repository for the CFR Java decompiler
https://www.benf.org/other/cfr
MIT License
2k stars 258 forks source link

Fix empty Java 15+ enum being dumped as regular class #290

Closed Marcono1234 closed 2 years ago

Marcono1234 commented 2 years ago

Relates to #252

Fixes empty enums (e.g. enum EnumTest { }) compiled with Java 15+ being dumped as regular class. I have simply adjusted getJava15Values to account for a NewObjectArray expression. Feel free to close this pull request and implement this in a saner / cleaner way, or let me know if I should change anything.

leibnitz27 commented 2 years ago

Sorry I took so long to get around to this! As per comment I think there's a 2-liner change - just want to figure out if my current overcomplication is overcomplicated for a reason or if because I'm overcomplicated.

leibnitz27 commented 2 years ago

Ah - guess I was just trying a bit too hard to re-use CollectedEnumData for a disjoint purpose.