Class#getEnumConstants breaking after Enum removals

XMLWordPrintable

    • Type: Bug
    • Resolution: Done
    • Priority: Minor
    • None
    • Affects Version/s: 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.

            Assignee:
            Unassigned
            Reporter:
            Tal K
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: