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
Post a Comment