Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8059631

Use of '#' to represent MethodHandle kind is confusing

XMLWordPrintable

    • b124
    • Not verified

        javap outputs MethodHandle constants as follows:

        #24 = MethodHandle #9:#33 // invokeinterface InterfaceMethodref$I.m:()V

        As is typical, "#33" is a cross-reference to constant pool entry 33, which in this case is an InterfaceMethodref.

        But "#9" has nothing to do with constant pool entry 9, or any other indexed list: it's simply an enum-style value, representing the reference_kind "invokeinterface" (see JVMS 5.4.3.5).

        It might be cleaner to drop the '#', or use some other (non-numeric?) representation.

              jjg Jonathan Gibbons
              dlsmith Dan Smith
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: