The code looks like:
import java.util.function.Consumer;
public class Test {
Consumer<Integer> lambda = key -> {
};
public Test() {
return; // NOTICE THIS LINE
}
}
the build output would be like:
~\Test.java:7:19
java: variable key might not have been initialized
java -version
:
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
os ver
: Microsoft Windows [版本 10.0.18363.1734]
You have rediscovered the JDK-8077667 bug. As stated in the bug report it was fixed in version 9.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With