Compile the following code:
class t {
void foo() { new inner(); }
class inner implements Runnable { };
}
You will get an error for the "new inner()" complaining that inner is an abstract class, but you wont get the error that inner is an abstract class and not declared so. What you need to *fix* the problem is the second, suppressed error because it will tell you what method you are not implementing. If you move inner to be a top-level class you get both errors, which is much more useful.
This worked correctly in Beta3, and got broken in Beta4 (I'm using build K).
class t {
void foo() { new inner(); }
class inner implements Runnable { };
}
You will get an error for the "new inner()" complaining that inner is an abstract class, but you wont get the error that inner is an abstract class and not declared so. What you need to *fix* the problem is the second, suppressed error because it will tell you what method you are not implementing. If you move inner to be a top-level class you get both errors, which is much more useful.
This worked correctly in Beta3, and got broken in Beta4 (I'm using build K).
- relates to
-
JDK-4111488 if any class in a nest has an error, none should generate code.
-
- Closed
-