classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: jdiff.sh (BETA)


From: Giannis Georgalis
Subject: Re: jdiff.sh (BETA)
Date: 21 Sep 2002 19:36:12 +0300
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Eric Blake <address@hidden> writes:> 
> Unchecked exceptions do not need to be reported. There are several
> places where Classpath purposefully omits mentioning unchecked
> exceptions in the throws clause, because it is just a waste of .class
> file size.
> 
> For example, these two declarations are equivalent, but the second
> compiles to less space:
> void m() throws RuntimeException {}
> void m() {}

Yes, however jdiff.sh completely ignores the throws clause and instead
parses the javadoc comments above the class definition. That way we
will make sure that the programmer is aware (and has implemented
correctly) the potential exceptional situations of his code. So:

/*
 * @throws RuntimeException (or @exception RuntimeException)
 */
public void m(){}

will be correct if and only if RuntimeException is documented in the
public void m()'s detailed description in the Sun's documentation.
Is that clear (and desirable)?

> Yes, it may be bad style, and even worse style is "int m()[]" instead
> of "int[] m()", but you should still check it, because it will help us
> clean up our bad style.

ok, I fully agree with you. 
 
> Likewise, your code should not worry about the "synchronized" keyword,
> on classes or on methods, because different implementations can
> successfully synchronize without marking everything in the same manner.

ok, the new version successfully ignores the "synchronized" keyword.

-- 
Is God willing to prevent evil, but not able? Then he is not omnipotent.
Is he able, but not willing? Then he is malevolent.
Is he both able and willing? Then whence cometh evil?
Is he neither able nor willing? Then why call him God?
(Epicurus)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]