Suppose you have the following classes:

     abstract class Foo {
         abstract void doSomething() throws MyException {
             ...
         }
     }

     class Bar extends Foo {
         void doSomething() {
             someCode();
         }
     }

Here, doSomething does not declare that it throws MyException since this 
particular implementation doesn't throw MyException.

Now, change doSomething() so that it calls someOtherCode(), which throws 
MyException:

     class Bar extends Foo {
         void doSomething() {
             someCode();
             someOtherCode();
         }
     }

You'll get ared underwave indicating that there's an uncaught exception. 
  Accept the suggestion to "Add Exceptions to Method Signature".  You 
get "Method doSomething() is inherited.  Do you want to add exceptions 
to method signatures in the whole method hierarchy?".  Click "Yes".  Result:

     abstract class Foo {
         abstract void doSomething() throws MyException, MyException {
             ...
         }
     }

     class Bar extends Foo {
         void doSomething() throws MyException {
             someCode();
         }
     }

The exception is added to the superclass even though it is already there.

_______________________________________________
Eap-bugs mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-bugs

Reply via email to