title: Why does eclipse say I have no return statement in this method
body: <p>I wrote a helper method for a class I am doing in java with Eclipse IDE. The code for that method is as follows </p>
  
  <pre><code>private foo getfooMonitor(String id)
  {
      if(fooList.isEmpty())
      {
          if (Mgr.getValue(Name, ListPath + id) == null)
          {
              return null;
          }
      }
      else
      {
          for(foo f : fooList)
          {
              if(f.getID().equalsIgnoreCase(id))
              {
                  return foo;
              }
          }
          return null;
      }
  }
  </code></pre>
  
  <p>I am curious as to why if the method will be forced to return something, since it has an <code>if then else</code> block which has a <code>return</code> statement hit no matter what, why eclipse would think I do not have a return statement? </p>
  
  <p>Is this eclipse enforcing some weird syntax because it has trouble parsing the <code>if then else</code> block to see the method will be forced to return, or is this a java thing with not allowing a <code>non void</code> method to be valid unless it has a return statement as the last line in a method body? </p>