Bug 40979 - The exception not handle error is not shown in the platform
Summary: The exception not handle error is not shown in the platform
Status: RESOLVED DUPLICATE of bug 30949
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-30 17:09 EDT by Lance Zhang CLA
Modified: 2003-07-31 08:51 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***