java - Why does eclipse say I have no return statement in this method -


i wrote helper method class doing in java eclipse ide. code method follows

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;     } } 

i curious why if method forced return something, since has if else block has return statement hit no matter what, why eclipse think not have return statement?

is eclipse enforcing weird syntax because has trouble parsing if else block see method forced return, or java thing not allowing non void method valid unless has return statement last line in method body?

not paths return. if mgr.getvalue(name, listpath + id) == null returns false method doesn't have return value


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -