Community
Participate
Working Groups
The following java source compiles without error using the IBM JDK 1.3.1 compiler, but gives an "Unreachable code" error (not warning) when using Eclipse 2.1.0: public class Foo { public int method() { return 7;; } } The extra semi-colon on the return statement shows as an error in Eclipse. Either the JDT compiler is incorrectly calling this an error, or the IBM JDK compiler is not reporting the error correctly. I'm assuming the former is true. The IBM JDK version used was: java version "1.3.1" Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1) Classic VM (build 1.3.1, J2RE 1.3.1 IBM Windows 32 build cn131-20020710 (JIT enabled: jitc))
Curious. This should only occur in 1.4 compliant mode.
Confirmed that my compliance level was set to 1.3
Fixed. Empty statements are now completely filtered out in 1.3 mode (not even reduced).
Actually, changed fix to rather always reduce empty statement nodes, but in 1.3 compliant mode, these will never cause unreachable reports. This is much better for DOM AST (which needs empty statements but not unreachable diagnosis).
Verified.