leibnitz27 / cfr

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

Enums are not desugared since Java 15 #252

Closed Marcono1234 closed 3 years ago

Marcono1234 commented 3 years ago

CFR version

bc8d9a2

Compiler

javac 16

Description

Sine Java 15 enums have a method $values() which creates the array containing the enum constants, see JDK-8241798.

This causes CFR's EnumClassRewriter to consider the enum to be malformed and prevents it from desugaring it.

Example

Any enum compiled with Java >= 15 should allow reproducing this, e.g.:

enum EnumTest {
    A,
    B;
}