Based on this conversation it sounds like we should have a new coding convention: - 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). Jody Martin Desruisseaux wrote: > Thanks for the feedback Jesse. > > I also fixed the assertion error in DirectPosition2D.hashCode(), but in this > case the assertion revealed a deeper issue (explained in my previous "Note on > equals(Object)" email). > > In short: DirectPosition2D is both a DirectPosition and Point2D. Unfortunatly > I > realized (thanks to the assertions) that it is safe for use only in: > > HashSet<DirectPosition> or HashMap<DirectPosition,?> > > it is unsafe for use in > > HashSet<Point2D> or HashMap<Point2D,?> > > (it could be the converse, but unfortunatly in can be only one or the other - > it > can not be safe in both cases). > > Collections that don't use hashCode() like ArrayList are unaffected. > > I documented this fact in the Javadoc. > > 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 > ------------------------------------------------------------------------- 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
