Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7819

Class#getEnumConstants breaking after Enum removals

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • None
    • None
    • CraftBukkit version 4258-Spigot-491f367-8fd64b0 (MC: 1.21) (Implementing API version 1.21-R0.1-SNAPSHOT)
    • Yes

      After the recent Enum -> interface changes, Class#getEnumConstants seems to return null.

      The following code:

      @Override
      public void onEnable() {
          showArray(Cat.Type.class);
      }
      
      public static void showArray(Class<?> clazz) {
          System.out.println(Arrays.toString(clazz.getEnumConstants()));
      }

      properly prints the array on older versions, but prints out null on 1.21.

      If it's not meant to have back-support can close this, but I assume it is seeing as Source of EnumEvil.java - CraftBukkit - SpigotMC Stash is there.

            Unassigned Unassigned
            Aya Tal K
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: