title: Data Binding giving NullPointerException when used with static method
body: <p>I am getting a <code>NullPointerException</code> when I use to format date with my <code>StringUtils</code> class. If I use it without <code>StringUtils</code>, it just works fine.</p>
  
  <p>I have added the import statement for <code>StringUtils</code></p>
  
  <p>I have this:</p>
  
  <pre><code>&lt;TextView
      android:layout_width="0dp"
      android:layout_height="wrap_content"
      android:layout_weight="1"
      android:text="@{StringUtils.getFormattedDate(user.date)}" /&gt;
  </code></pre>
  
  <p>This gives me an error in my <code>StringUtils</code> method:</p>
  
  <pre><code>public static String getFormattedDate(String unformattedDate) {
          // unformattedDate will be in format of yyyy-mm-dd
          // Convert it to d mmm, yyyy
          SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
          String date = null;
          try {
              Date d = df.parse(unformattedDate);   // &lt;&lt;--------- Here
              SimpleDateFormat dateFormat = new SimpleDateFormat("d MMM, yyyy");
              date = dateFormat.format(d.getTime());
          } catch (ParseException e) {
              e.printStackTrace();
          }
          return date;
      }
  </code></pre>
  
  <p>When I checked with debugger, <code>unformattedDate</code> is <code>null</code> from the beginning. The correct method is called but the value passed is <code>null</code>. This is strange.</p>
  
  <p>When I use it like this in the layout file:</p>
  
  <pre><code>&lt;TextView
      android:layout_width="0dp"
      android:layout_height="wrap_content"
      android:layout_weight="1"
      android:text="@{user.date}" /&gt;
  </code></pre>
  
  <p>It gives me no error, and date is displayed on screen!</p>
  
  <p>I have tried cleaning the project and re-run it. But no success.</p>