I have a very confusing situation:
I have a class that is compiled with string information (verified with javap -l ). This class is loaded and managed by ASM. I checked that the correct class was loaded (i.e. not an obsolete class file from another place). And I also made sure that the ASM ClassReader.SKIP_DEBUG flag is not set. Now, if I call Thread.currentThread().getStackTrace() , I get a StackTraceElement relative to this class, which skips row information. When debugging in Eclipse, line information is displayed in the stack trace. I also made sure that the JVM starts with -Xint to make sure that the information is not deleted as an optimization when compiling the JIT code.
And the most confusing: although all classes are loaded and processed the same way, this is true only for some classes, and not for all. This is the main reason why I think this has something to do with the JVM.
So my question is: Does the JVM indicate line information in the stack trace, if so, when and how can I prevent this?
Edit: Just to make everything clear: this is the class file of the source file that I have in front of me, and not a third-party library. And, as it should be clear, I tried to make sure that the information is in the bytecode.
Edit: Now I even found an example where one StackTraceElement contains information about the line number and the other does not, and they are associated with various methods from the same class >!
source share