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

Zero name_index item of MethodParameters attribute cause MalformedParameterException.

XMLWordPrintable

        JVMS says:
        "If the value of the name_index item is zero, then this parameters element indicates a formal parameter with no name. "

        But j.l.r.Executable.getParameters() throw MalformedParameterExeption: Invalid parameter name "".
        This looks as if parameter had empty-string name.

        It is reproduced on Solaris with 8, 8u26, 9 and 9.0
        and on Windows 7 with 8u20.

        Minimized test:
        ------------------------------------------------------------

        public class Second {
            public static String method(int i){
                return "in";
            }

            public static void main(String[] args) throws NoSuchMethodException {
                Second.class.getMethod("method", int.class).getParameters();
            }

        }
        ------------------------------------------------------------

        After compilation (javac -parameters Second.java) MethodParameters attribute of "method" was changed from "0x0100110000;" to "0x0100000000;". Modified version is attached.

        The following JCK test will fail due to this bug: vm/classfmt/atr/atrmtp003/atrmtp00303m1/atrmtp00303m1.

              emc Eric Mccorkle
              kbarzilovich Konstantin Barzilovich (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: