cfr icon indicating copy to clipboard operation
cfr copied to clipboard

Enum constants do not dump annotations

Open Col-E opened this issue 11 months ago • 0 comments

Environment

  • CFR version - 0.152
  • Compiler - Any

Description

The ClassFileDumperEnum deviates from the way most fields are dumped since enum constants are an edge case. There is no dumping of annotations before the constant's name, so any enum in the class file on these are effectively ignored.

Example

See attached ZIP. Contains a single class with an enum class that has an annotated enum constant.

example.zip

Assumed fix

Update the enum dumper to get the org.benf.cfr.reader.entities.Field of each enum constant, and prepend annotations similar to how the standard field dumper does it.

Col-E avatar Jan 19 '25 08:01 Col-E