File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

warning in finally

 
pallavi utukuri
Ranch Hand
Posts: 182
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

the above is giving this error
warning: finally clause cannot complete normally
}
^
1 warning
can any1 plz explain this
(Adding code tags - which I just love doing)
[ April 20, 2004: Message edited by: Barry Gaunt ]
 
Dan Andrei
Ranch Hand
Posts: 92
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its just a warning not an error, the code compiles
If your question IS WHY DOES IT GIVE A WARNING ?
I,ll try a long shot here:
the finally block must comlplete before the method retruns. The compiler sees a return which means abnormal completion, so it barks a warning.
If some stement was after the return it would give a compile error
 
pallavi utukuri
Ranch Hand
Posts: 182
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
abnormal completion due to return in finally or try
 
K Patel
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whats your version of JDK? I have no warnings popping up when I compiled Fry.java and TooHotException.java.
 
Kaustubh Patil
Ranch Hand
Posts: 164
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I too do not get any warnings...
 
Erwin Morales
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode) there are this warning of Pallavi, wich is your compiler K and Kaustubh?.
Pallavi, your abnormal completion is due a finally in the method start, it's a first code block in execution and the finally 'almost' always execute
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic