My colleague Chris Povirk noticed that in the following example, javac emits deprecation warnings for method invocations that refer to the deprecated method A.b, but not for uses of that method in other annotations.
Ideally it would report a diagnostic for both usages of the deprecated element.
```
@interface A {
@Deprecated
/**
* @deprecated foo
*/
boolean b() default false;
}
```
```
@A(b = true)
// ^
// expected a deprecation warning on use of b above
class B {
void x(A a) {
a.b();
}
}
```
$ javac -fullversion
javac full version "19-ea+34-2229"
$ javac -deprecation *.java
B.java:6: warning: [deprecation] b() in A has been deprecated
a.b();
^
1 warning
Ideally it would report a diagnostic for both usages of the deprecated element.
```
@interface A {
@Deprecated
/**
* @deprecated foo
*/
boolean b() default false;
}
```
```
@A(b = true)
// ^
// expected a deprecation warning on use of b above
class B {
void x(A a) {
a.b();
}
}
```
$ javac -fullversion
javac full version "19-ea+34-2229"
$ javac -deprecation *.java
B.java:6: warning: [deprecation] b() in A has been deprecated
a.b();
^
1 warning