Community
Participate
Working Groups
Compile this code with -warn:+emptyBlock. public class X { static class Y { public void foo(int i) {} // this block is reported as empty } static Y FakeInvocationSite = new Y(){ public void foo(int i) {} // this block is not reported as empty }; }
The problem is not detected for method inside anonymous declaration that are initializing a field declaration, because this is parsed when the diet mode is true and the problem is not reported during the diet parse. I'll investigate how to fix it.
Created attachment 52364 [details] Proposed fix
Created attachment 52365 [details] Regression tests
Released for 3.3M3.
Added regression tests org.eclipse.jdt.core.tests.compiler.parser.ParserTest#test025/26
Verified for 3.3 M3 using build I20061030-0010