Enum values() and valueOf() methods should not be synthetic (ACC_SYNTHETIC)

Issue #283 resolved
Jesper Öqvist
created an issue

ExtendJ 8.1.0-40-g660b9e4 Java SE 7

There is currently a problem when ExtendJ loads enum bytecode generated by ExtendJ. ExtendJ marks the implicit values() and valueOf() methods as synthetic, and thus ExtendJ does not load these methods from bytecode. However, due to the changes in commit 660b9e43bd0efe591f74438ab2d4eb6e9c23cd46, this leads to missing declarations for these methods if they are used.

ExtendJ should change its code generation to use the same bytecode access attributes for implicit enum methods as Javac does.

An example of enum bytecode generated by Javac:

  public static pkg.Trait[] values();
  public static pkg.Trait valueOf(java.lang.String);

Comments (1)

  1. Log in to comment