Bug 40979

Summary: The exception not handle error is not shown in the platform
Product: [Eclipse Project] JDT Reporter: Lance Zhang <zhangl>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0 M3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Lance Zhang CLA 2003-07-30 17:09:43 EDT
Look at the following code:

The test(int, int) has an exception need to be handled, but the workspace did 
not show any error and compiling was OK. This class did not compile in IBM JDK 
and SUN jdk using "javac".

If I remove the "return" clause in the finally block, the error is shown. But 
that is not enough...

This is also happening in WSAD 5.

/Lance




package com.test;

 public class Test1 {
	public static void main(String [] args) {
		TestVisual t=new TestVisual();
		try {
			throw new Exception();
		} catch (Throwable e) {	
			test(1,2);
		} finally {
			return;
		}	
	}
	public static void test(int i, int j)throws Exception {
			throw new Exception("Hello world");
	}		
     
}
Comment 1 Olivier Thomann CLA 2003-07-31 08:50:50 EDT
In your code, there is no need to handle the exception, because it is never 
thrown. Your finally block will return consuming the potential exception thrown 
by the try/catch statement.
This is a duplicate of bug 30949.
Comment 2 Olivier Thomann CLA 2003-07-31 08:51:07 EDT

*** This bug has been marked as a duplicate of 30949 ***