title: Getter nullpointer without calling it
body: <p>I have a problem with <code>nullPointer</code> in getter method. </p>
  
  <p>Here is the code:</p>
  
  <pre><code> public String getTitle()
    {
      if(!title.isEmpty())
          return title;
      else 
          return "foo";
    }
  </code></pre>
  
  <p>When I change this to normal getter it works perfectly.</p>
  
  <pre><code>public String getTitle()
    {
      return title;
    }
  </code></pre>
  
  <p>Where is the trick? Is there a reflection trick?</p>
  
  <p><strong>UPDATE
  The problem is not null checking, but excecuting getter without calling it</strong></p>
  
  <p>STACKTRACE</p>
  
  <p><code>org.codehaus.jackson.map.JsonMappingException: (was java.lang.NullPointerException)     (through reference chain: java.util.ArrayList[0]-  &gt;si.mikropis.webkiosk.model.vao.wine.Wine["title"])</code></p>
  
  <p><code>Caused by: java.lang.NullPointerException
         at si.mikropis.webkiosk.model.vao.base.BaseModel.getTitle(BaseModel.java:41)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.codehaus.jackson.map.ser.BeanPropertyWriter.get(BeanPropertyWriter.java:483)
         at org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:418)
      at org.codehaus.jackson.map.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:150)
      ... 32 more</code></p>