The feature would not be as complicated as you say.

What I'm suggesting is that, if the helloWorld() method didn't declare to
throw DummyException (assuming DummyException is not a RuntimeException),
I'd like the catch statement underlined in the same way assignments of the
wrong type are underlined. No drilling down into the code; it's all based
on the signatures.

However, this feature, in concert with the other half of my request - to
underline exceptions in the throws clause that are never thrown - would
make it possible to clean up unnecessary exception work very quickly,
without having to compile about 20 times to find everywhere that used to
catch the exception thrown

The funcitonality I'm trying to achieve (easy removal of unnecessary throws
and catches) could be achieved with a refactoring to remove an exception
from a signature, and in turn remove or comment out:
     1. any catch clauses or
     2. parts of throws clauses where the method is allowed emenate

for all usages of the changed method.
There would be a lot of tricks to this, though, e.g. detecting if any other
code in the try block still throws the same exception, and following
through many methods where the exception is allowed to escape from the
method. I think the other two suggestions would be much easier to
implement.

>From: "Michael Descher" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Subject: AW: [Eap-features] Re: Underline extraneous exception work.
>Date: Fri, 8 Mar 2002 09:05:53 +0100
>charset="iso-8859-1"
>Reply-To: [EMAIL PROTECTED]
>
>But why marking valid java code? You cannot remove the catch block without
>breaking compilation. Furthermore I think this would be quite hard to
>implement.
>
>try {
>    helloWorld();
>} catch (DummyException e) {
>    ...
>}
>
>Now even if there is no "throw new DummyException()" in method
"helloWorld"
>you would have to check all methods called in "helloWorld" for possible
>DummyExceptions. In case you find some, you would have to go further to
see
>if any of these methods calls a method throwing a DummyException and so
on.
>
>I just don't get the point of marking such a catch block since I don't
know
>what it should be good for. :-)
>
>Michael

Graham Lea

--
Software Engineer
Forge Research Pty Ltd
Suite 116, Bay 9, Locomotive Workshop
Australian Technology Park, Cornwallis Street
Eveleigh NSW 1430 Australia
Phone: +61 2 9209 4152   Fax: +61 2 9209 4172
www.forge.com.au

----------------------------------------------------------------------
This message contains privileged and confidential information intended
only for the use of the addressee named above.  If you are not the
intended recipient of this message you must not disseminate, copy or
take any action in reliance on it.  If you have received this message
in error please notify the sender immediately.  Any views expressed in
this message are those of the individual sender, except where the
sender specifically states them to be the views of another (including
a Body Corporate).
----------------------------------------------------------------------


_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-features

Reply via email to