We've got the experts to help. I see decompilers generating the code and javac compiling it without difficulty.
Inner classes can also be private , protected , or static .
Therefore, the compiler should reject the code in your example. In fact, this is a known bug, fixed in JDK 1.2. Out of curiosity, we checked to see if the synchronized modifier on a class had any effect in the generated code. The class files generated were exactly the same. It is also a bug for a decompiler, such as javap , to report classes as being synchronized .