Community
Participate
Working Groups
The following code, under M6 (and M5) will not successfully compile: public class tester { public int testmethod() { int itest = 0; return itest;; } } Initially I went into the "project->compiler->unused code" tab and changed the "unnecessary semicolon" option to warning, then ignore. Didn't make any difference - perhaps because it's after a return? Eclipse 2 had an "Unreachable code" option under the problems tab - has this been acidentally missed in 3?
We did remove the setting to control the severity of unreachable code as this was breaking the language spec which states that this is an error. Note: we did introduce this setting historically to ease migration from people coming from different tools. Now you need to understand 2 things: - we have added a warning to diagnose unnecessary empty statements - Java 1.4 treats semicolons as empty statements. 'return itest;;' is really 2 statements: a return statement followed by an empty one. Java 1.3 did not consider extra semicolons as real statements, and thus did not complain. So you have 2 options: - switch compiler compliance back to 1.3 - remove the extra semicolon (what value does it provide?)
Working as designed