No, the debug information in the class file does not contain enough information to allow this.
You can, however, improve on the situation. There are two things that can cause a NPE to be thrown:
- A
.
dereferencing a variable, like foo.bar()
.
- A
[
indexing an array, like args[0]
.
If you write your code so there is only one of these on a given code line, there is simply no doubt about which one caused the NPE. It will introduce a lot of temporary variables but then you have more information readily available when debugging.