Given a line number, the code file, as well as the compiled class file if necessary, what is the most elegant way to get the signature of the surrounding method (if the line number is even in a method)?
Things to keep in mind:
- the line might not even be in a method
- the line might be in a method of an inner or anonymous class
While Googling I discovered this duplicate question so I'm closing this down myself.