I noticed the treesitter imenu definitions for java in java-ts-mode.el have the following:

 

  ;; Imenu.

  (setq-local treesit-simple-imenu-settings

              '(("Class" \\`class_declaration\\' nil nil)

                ("Interface" \\`interface_declaration\\' nil nil)

                ("Enum" \\`record_declaration\\' nil nil)

                ("Method" \\`method_declaration\\' nil nil)))

  (treesit-major-mode-setup))

 

  The 3rd definition for enums should either be for “Record” if that was the intention or match against \\`enum_declaration   if it really was meant for enums.

 

Ben