-
Sub-task
-
Resolution: Delivered
-
P3
-
16
-
Verified
Prior to JDK 16, the `javac` compiler accepted annotations declared as local interfaces. Now the JLS 16 at section 14.3 forbids it. For example, the `javac` compiler had accepted code such as:
```
class C {
void m() {
@interface A {}
}
}
```
This code is no longer acceptable according to Section [14.3] of the JLS 16:
"A local interface may be a normal interface (§9.1), but not an annotation interface (§9.6)."
To fix this issue, the `javac` compiler implementation has been synchronized with the JLS 16, so that annotation interfaces cannot be declared as local interfaces.
```
class C {
void m() {
@interface A {}
}
}
```
This code is no longer acceptable according to Section [14.3] of the JLS 16:
"A local interface may be a normal interface (§9.1), but not an annotation interface (§9.6)."
To fix this issue, the `javac` compiler implementation has been synchronized with the JLS 16, so that annotation interfaces cannot be declared as local interfaces.