FULL PRODUCT VERSION : java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode) ADDITIONAL OS VERSION INFORMATION : Linux localhost.localdomain 4.8.15-300.fc25.x86_64 #1 SMP Thu Dec 15 23:10:23 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux A DESCRIPTION OF THE PROBLEM : See the testcase in the attachment classpath_test.zip in the following bug: https://github.com/lukehutch/fast-classpath-scanner/issues/103 If a static initializer in the main class is called before the main method, and it uses lambdas, then the invocation of the lambdas hangs. The Java 8 lambda system does not seem to be fully initialized until the body of the main method is run. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Check out the classpath_test.zip code linked above; load it into Eclipse as a new Maven project; and then run it in the debugger. The code will hang (in the only active thread) when the lambda is invoked, and the debugger can't even provide a useful stacktrace. EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - The code should not hang. ACTUAL - The code hangs. REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- See link above. ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : Don't call the lambda-calling code in a static initializer block in main, call it from the main method itself.
|