Name: tb29552 Date: 07/30/97
Reported by: company - University College London (Computer Science Dept.)
email - ###@###.###
When adding a local variable to a method, I accidentaly declaired
it as static and final. Rather than report this as wrong, the
compiler kind of 'fell over'. eg:
==== ABug.java ===========================
{
bar()
{
// confusion...
static final int barfoo = 0;
if (true)
{
// do something
}
}
}
==========================================
produces the following compiler errors:
ABug.java:6: '}' expected.
{
^
ABug.java:9: Statement expected.
static final int barfoo = 0;
^
ABug.java:10: Type expected.
if (true)
^
3 errors
... since I had made edits in a few surrounding methods as well,
this took me a while to track down.
company - University College London (Computer Science Dept.) , email - ###@###.###
======================================================================
- duplicates
-
JDK-1262635 vague error generated for field modifiers in local context
- Closed