Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"compiler message file broken" - I guess a java compiler bug?

Take the code:

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

    interface I {
        private void test() {}
    }
}

And try to compile. I receive:

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

Where compiler message file broken seems to be something incomprehensible. Is it a bug or I am missing something?

P.S. Submitted a bug: ID : 9052216

like image 687
Andremoniy Avatar asked Jan 11 '18 20:01

Andremoniy


1 Answers

Admitted as a bug by the Java Development Support:

https://bugs.openjdk.java.net/browse/JDK-8194997

like image 160
Andremoniy Avatar answered Oct 20 '22 06:10

Andremoniy