title: Expected null pointer causing an unexpected InvocationTargetException
body: <p>An XML file is being used as a temporary cache to store temporary values via a SOAP request (several configuration values).  Multiple threads will be using this file, so I don't want to write to the file if it has already been updated.  In the first pass through the code, I expect the cache to return null, after which the file will be updated.  However, I am getting an <code>InvocationTargetException</code> when exiting the finally block, and the program fails.  I don't understand why the null <code>CacheValues</code> object is throwing the exception. </p>
  
  <pre><code>public class TempCache{
       private final ReadWriteLock myLock = new ReentrantReadWriteLock();
       private final MyCache cache = XmlCache.getInstance(); //creates singleton         
                                                             //instance, but doesn't 
                                                             //set values upon 
                                                             //initialization...
  
       public CacheValues getCache(){
           Lock lock = myLock.readLock();
           CacheValues cv = null;
  
           try{
               lock.lock();
               cv = cache.getCacheValues();  //returns null on the first pass...
  
           }finally{
               lock.unlock();
           }                    // exception thrown here
  
           if(cv == null){
               refreshCache(); //submits SOAP request to set the xml cache values
           }
  
     ...
  }
  </code></pre>