A DESCRIPTION OF THE REQUEST :
If a semi-colon is placed right after a close-paren of an if-statement, the compiler lets it through without complaint:
if (statement); // semi-colon here is not caught
{
some code;
}
JUSTIFICATION :
I spent several hours trying to debug a code, thinking I had some kind of data-type error, when it was only the semi-colon.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compiler complains or at least warns of the syntax problem.
ACTUAL -
Compiles without a warning or error.
---------- BEGIN SOURCE ----------
This is very simple. See code above.
---------- END SOURCE ----------
###@###.### 2005-1-14 00:50:13 GMT
If a semi-colon is placed right after a close-paren of an if-statement, the compiler lets it through without complaint:
if (statement); // semi-colon here is not caught
{
some code;
}
JUSTIFICATION :
I spent several hours trying to debug a code, thinking I had some kind of data-type error, when it was only the semi-colon.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compiler complains or at least warns of the syntax problem.
ACTUAL -
Compiles without a warning or error.
---------- BEGIN SOURCE ----------
This is very simple. See code above.
---------- END SOURCE ----------
###@###.### 2005-1-14 00:50:13 GMT
- duplicates
-
JDK-4906100 Javac should give a warning for empty code blocks after condition statements
-
- Closed
-