varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: None
    • Component/s: tools
    • None
    • b100
    • Verified

      Certain warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact.

      Here is an example:

      .../jdk/test/java/lang/invoke/BigArityTest.java:295: warning: non-varargs call of varargs method with inexact argument type for last parameter;
                      r = mh_VA.invokeExact((Integer[])args);
                                            ^
        cast to Object for a varargs call
        cast to Object[] for a non-varargs call and to suppress this warning

      The type Integer[] is defined to be literally present in the bytecode call site descriptor. The suggested changes (cast to Object or cast to Object[]) would presumably be erroneous, since they would change the call site descriptor to one which is incompatible with the specified one.

            Assignee:
            Maurizio Cimadamore
            Reporter:
            John Rose
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: