Jody Garnett a écrit :
> http://docs.codehaus.org/display/GEOT/5.1.7+Use+of+Assertions%2C+IllegalArgumentException+and+NPE
> 
> Page is marked as pending; please review (and if you have that original
> link to the Java policy that would be cool).

Done (added the link to Sun web site).

I could add that in my experience, the assertions that helped me the most are
post-conditions and invariants. They helped me more than argument checks in
private methods. So I nuanced the sentence "the most common use is to check
method parameters". The later is the easiest use (easy to figure out), but less
straightforward assertions (post-conditions, invariants) are often more 
valuable.

e.g. In the referencing module, after a map projection, an assertion performed
the inverse map projection and check the result with the original point
(pre-condition).

e.g. In DirectPosition.equals(Object) method, if the result is "true", then the
assertion ensures that hashCode() are identical (this is the AssertionError
reported by Jesse).

        Martin

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to