JDK-4090852 : empty statements are not treated as statements that need to be reachable
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 1.1.3
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5.1
  • CPU: generic
  • Submitted: 1997-11-05
  • Updated: 1997-11-06
  • Resolved: 1997-11-06
Related Reports
Duplicate :  
Description
Yeah, I know.. pretty picky... But the JLS appears to require statement
not reachable errors on the following:

class empty {
    int i;
    int f1() {
        return 1; /* unreachable empty statement -> */ ;
    }
    int f2() {
        while ( false ) /* unreachable empty statement -> */ ;
        return 2;
    }
}


If following the JLS spec is important, this should be fixed...  Unfortunately
there are 3 JCK positive lang testcases that have these kind of errors
in them. See bug 4090844.

It appears that declaration statements (without initializers) are already
given the full statement treatment in that if you replace the above
empty statements with "int k;", you WILL get errors.

This was originally found to be a JLS issue by the Modena testbase.

-kto

kelly.ohair@Eng 1997-11-05