C
Christopher Benson-Manica
If the following annotations are specified in different files, javac
(correctly) rejects them:
public @interface Bar {
Baz baz();
}
public @interface Baz {
Bar bar();
}
It seems to me then that the following should also be rejected on the
same grounds:
public class Foo {
public static @interface Bar {
Foo.Baz baz();
}
public static @interface Baz {
Foo.Bar bar();
}
}
However, javac 1.5.0_11 accepts this class. Is there some arcane
scope reason why the above is acceptable, or is javac wrong?
(correctly) rejects them:
public @interface Bar {
Baz baz();
}
public @interface Baz {
Bar bar();
}
It seems to me then that the following should also be rejected on the
same grounds:
public class Foo {
public static @interface Bar {
Foo.Baz baz();
}
public static @interface Baz {
Foo.Bar bar();
}
}
However, javac 1.5.0_11 accepts this class. Is there some arcane
scope reason why the above is acceptable, or is javac wrong?