Hi,

I just ran uDig trunk with assertions enabled and the following  
snippet is throwing an assertion error.

@Override
     public boolean equals(final Object object) {
         if (object instanceof DirectPosition) {
             final DirectPosition that = (DirectPosition) object;
             final int dimension = getDimension();
             if (dimension == that.getDimension()) {
                 for (int i=0; i<dimension; i++) {
                     if (Double.doubleToLongBits(this.getOrdinate(i)) !=
                         Double.doubleToLongBits(that.getOrdinate(i)))
                     {
                         return false;
                     }
                 }
                 if  
(Utilities.equals(this.getCoordinateReferenceSystem(),
                                       
that.getCoordinateReferenceSystem()))
                 {
                     assert hashCode() == that.hashCode() : this;    
<-------  This line is the error
                     return true;
                 }
             }
         }
         return false;
     }

I'm trying to debug some of my own code and this error is getting in  
the way.  Here's the code that is calling it.  Maybe there is a better  
way for the calling code to be written.

CoordinateReferenceSystem WGS84 = CRS.decode("EPSG:4326"); // latlong
         CoordinateReferenceSystem BC_ALBERS = CRS.decode("EPSG:3005");

         MathTransform transform = CRS.findMathTransform(BC_ALBERS,  
WGS84 );
         DirectPosition here  = new DirectPosition2D( BC_ALBERS,  
1187128, 395268 );
         DirectPosition there = new DirectPosition2D( WGS84,  
-123.47009555832284,48.543261561072285 );
                
         DirectPosition check = transform.transform( here, new  
GeneralDirectPosition(WGS84) );
         if( check.equals(there)){     <------ This line is where the  
exception is being thrown.
                return true;
         }

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to