title: Why Java compiler does not provide caller's line number information?
body: <p>C# has these really nice compiler annotations: <code>CallerMemberName</code>, <code>CallerFilePath</code> <code>CallerLineNumber</code> which (as names say) caller's member name, file path and line number. This makes things like logging source code line numbers so easy (and efficient).</p>
  
  <p>Before Java 9's StackWalker, it seems the only option is to use <code>getStackTrace()</code> which is very expensive. Why it took Java so long to include a solution?</p>
  
  <p>Also, how efficient is Java 9's StackWalker compared with a simple compile time computed parameter? I guess difference is huge... which begs the question: why Java <em>can't</em> have compile time computed parameters?</p>