title: Find out what variable is throwing a NullPointerException programmatically
body: <p>I know I can find out if a variable is null in Java using these techniques:</p>
  
  <ul>
  <li>if <code>(var==null)</code> -> too much work</li>
  <li><code>try { ... } catch (NullPointerException e) { ...}</code> -> it tells me what line is throwing the exception</li>
  <li>using the debugger -> by hand, too slow</li>
  </ul>
  
  <p>Consider this line of code:</p>
  
  <pre><code>if (this.superSL.items.get(name).getSource().compareTo(VIsualShoppingList.Source_EXTRA)==0)  {
  </code></pre>
  
  <p>I would like to know if there's a generic way to find out programatically what variable (not just the line) is throwing the NullPointerException in a certain area of code. In the example, knowing that</p>