aionnetwork / AVM

Enabling Java code to run in a blockchain environment
https://theoan.com/
MIT License
49 stars 25 forks source link

Enum depends on $VALUES name #357

Closed jeff-aion closed 5 years ago

jeff-aion commented 5 years ago

Our implementation of Class.getEnumConstantsShared() assumes that the compiler has generated a field called $VALUES in Enum classes but this is only what javac does (the Eclipse compiler, for example, calls this field ENUM$VALUES).

The JDK implementation of this method depends on the generated method values, which is required for other Enum uses, as well.

We should update our implementation to use this approach, instead of relying on this specific behaviour of javac.