Summary: | Java compiler doesn't dected always unreported exception | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Gaetano Di Gregorio <gaetano.digregorio> |
Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
Status: | RESOLVED DUPLICATE | QA Contact: | |
Severity: | critical | ||
Priority: | P3 | ||
Version: | 2.1 | ||
Target Milestone: | 2.1 RC3 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Gaetano Di Gregorio
2003-03-10 08:43:32 EST
Duplicate of bug 30949. This is not a bug. javac 1.3.1 has a bug. The finally block returns. Therefore there is no uncaught exceptions. *** This bug has been marked as a duplicate of 30949 *** According the language specification at http://java.sun.com/docs/books/jls/second_edition/html/statements.doc.html#23665 3 - If execution of the try block completes abruptly because of a throw of a value V, then there is a choice: - If the run-time type of V is not assignable to the parameter of any catch clause of the try statement, then the finally block is executed. Then there is a choice: - If the finally block completes normally, then the try statement completes abruptly because of a throw of the value V. It should throw an IOException if the createNewFile() throw such an exception, no ? Unless I don't understand this spec :( According to 'http://java.sun.com/docs/books/jls/second_edition/html/statements.doc.html#5 894', the return statement in the finally block makes the finally block complete abruptly. I see now that you're right. Thanks for the explanation. I Was confused because of javac 1.3.1 bug. This bug can be closed. |