A DESCRIPTION OF THE PROBLEM :
`var` emits deprecation warnings that do not point to the file or position of the warning. This leaves me completely unable to determine where the deprecation warning is coming from without setting a breakpoint in javac.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. `javac -Xlint:deprecation Test.java`
2. See results.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
```
Test.java:7: warning: [deprecation] Depr in unnamed package has been deprecated
for (var deprValue : deprecatedList) {
^
1 warning
```
ACTUAL -
```
warning: [deprecation] Depr in unnamed package has been deprecated
1 warning
```
---------- BEGIN SOURCE ----------
```
import java.util.List;
public class Test {
{
@SuppressWarnings("deprecation")
List<Depr> deprecatedList = List.of();
for (var deprValue : deprecatedList) {
// ...
}
}
}
@Deprecated
class Depr {}
```
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use a debugger to breakpoint in the logging of the deprecation warning and check what file it's coming from.
FREQUENCY : always
`var` emits deprecation warnings that do not point to the file or position of the warning. This leaves me completely unable to determine where the deprecation warning is coming from without setting a breakpoint in javac.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. `javac -Xlint:deprecation Test.java`
2. See results.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
```
Test.java:7: warning: [deprecation] Depr in unnamed package has been deprecated
for (var deprValue : deprecatedList) {
^
1 warning
```
ACTUAL -
```
warning: [deprecation] Depr in unnamed package has been deprecated
1 warning
```
---------- BEGIN SOURCE ----------
```
import java.util.List;
public class Test {
{
@SuppressWarnings("deprecation")
List<Depr> deprecatedList = List.of();
for (var deprValue : deprecatedList) {
// ...
}
}
}
@Deprecated
class Depr {}
```
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use a debugger to breakpoint in the logging of the deprecation warning and check what file it's coming from.
FREQUENCY : always