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

compiler message file broken: key=compiler.misc.cant.resolve.args arguments=method, test, , , {4}, {5}, {6}, {7}

XMLWordPrintable

    • generic
    • generic

      FULL PRODUCT VERSION :
      java version "9.0.1"
      Java(TM) SE Runtime Environment (build 9.0.1+11)
      Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      17.2.0 Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64

      A DESCRIPTION OF THE PROBLEM :
      The following code being compiled gives incomprehensible error message:

      public class A {

          public static void main(String[] args) {
              new Thread(((new I() {}))::test).start();
          }

          interface I {
              private void test() {
              }
          }

      }

      Error message:

      A.java:5: error: invalid method reference
              new Thread(((new I() {}))::test).start();
                         ^
        compiler message file broken: key=compiler.misc.cant.resolve.args arguments=method, test, , , {4}, {5}, {6}, {7}
      1 error


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      javac A.java


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      A.java:5: error: invalid method reference
              new Thread(((new I() {}))::test).start();
                         ^
        compiler message file broken: key=compiler.misc.cant.resolve.args arguments=method, test, , , {4}, {5}, {6}, {7}
      1 error


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class A {

          public static void main(String[] args) {
              new Thread(((new I() {}))::test).start();
          }

          interface I {
              private void test() {
              }
          }

      }
      ---------- END SOURCE ----------

        1. A.java
          0.2 kB
          Fairoz Matte

            sdama Srinivas Dama (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: