Re: Counting number of exceptions in a Java class





Manu Mahendru wrote On 01/10/06 12:48,:
> Hmmmm.... I should have put it better.
>
> What I meant was that I need to count the total number of exceptions
> thrown by the methods in all classes in a project - they may be caught
> some place else... but if they are being thrown... I need to count
> them.
>
> I was thinking of javadocs... but thot checkstyle would be better. Will
> have a look at both.
>
> As for the usefullness of the metric... in my case it does seem to be a
> worthwhile figure to have.

I think you still have a specification issue.
For example, in

void foo()
throws SocketException, ProtocolException
{ ... }

void bar()
throws IOException
{ ... }

how many exceptions do you want to count for each method?
(Note that bar() can throw anything foo() can, and more.)

--
Eric.Sosman@xxxxxxx

.



Relevant Pages

  • Re: Reflection problem
    ... I'm pretty sure that there are no exceptions being thrown while ... >> Incoming mail is certified Virus Free. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Configuration Error Not Helpful
    ... >What kind of error in the configuration section causes the exception to be ... schema validation, and any error that gets thrown from that gets this ... those exceptions never got displayed. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: sending over DO seems to make main process block?
    ... DO is one of the few places in Cocoa where exceptions are thrown that ... an exception may be thrown when the ... avoid deadlock. ... the sender expects to be called back from the receiver, ...
    (comp.sys.mac.programmer.help)
  • Re: throw in a finally
    ... > other well-documented texts available that point out this problem. ... > that the reasons behind it are the same as the reasons behind why ... Catch exceptions thrown in a finally even if the method declares they are ... Catch exceptions and just log them. ...
    (comp.lang.java.programmer)
  • Re: How much processor resources do try-catch blocks in C# use
    ... You are right...if no exceptions are thrown, ... Marc Butenko ... > I was discussing with someone how much processor resources try-catch ...
    (microsoft.public.vsnet.general)