Skip to content

@Desugar does not strip out Record attributes, resulting in ASM treating those classes as records. #187

Description

@Nikolay-Sitnikov

The Record attribute specifies the record fields of the class: https://docs.oracle.com/javase/specs/jvms/se21/html/jvms-4.html#jvms-4.7.30

When observing a @Desugared record with javap -c -v, the following lines were printed at the end of the output:

InnerClasses:
  static #10;                             // class dev/rndmorris/salisarcana/common/recipes/ReplaceWandCoreRecipe$1
SourceFile: "ReplaceWandCoreRecipe.java"
Record:
  net.minecraft.item.ItemStack wandItem;
    descriptor: Lnet/minecraft/item/ItemStack;

  thaumcraft.api.wands.WandRod newRod;
    descriptor: Lthaumcraft/api/wands/WandRod;

  int screws;
    descriptor: I

  int conductors;
    descriptor: I

This should not be present, since this class should not be a record.

This is causing problems, because ASM will throw an error & prevent class loading if an ASM transformer with too low of a specified version encounters a record, which causes the program to crash when it encounters @Desugared records.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions