Community
Participate
Working Groups
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"); } }
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.
*** This bug has been marked as a duplicate of 30949 ***