File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes return missing statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "return missing statement" Watch "return missing statement" New topic

return missing statement

murali kante

Joined: Nov 09, 2001
Posts: 9
the following snippet gives me a compile time error......saying missing return statement. where I am doing mistake....
public RegistryService getRegistryService(){
registryService = jaxrConnection.getRegistryService();
return registryService;
}catch(Exception exception){
System.out.println"RegistryClientImpl : :"+exception);
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
Since you don't have a return statement in your catch block, you have the possibility of not reaching a return statement, hence the error. You can either put a return statement in the catch block, or take the return out of the try block and stick it after the whole try/catch stuff.
[This message has been edited by jason adam (edited December 09, 2001).]
I agree. Here's the link:
subject: return missing statement
It's not a secret anymore!