You're right, Node assumes that the EdgeEndStar argument is non-null.
(By the way, there definitely is a concept of null in Java, and it's
used in exactly the same way that a null pointer is used in C++)

Node was never written to be a general-purpose class, so not too much
attention was paid to hand-holding.  It is assumed that the client uses
the class correctly.  In Java this is self-detecting, since any use of a
null pointer will cause a nice exception to be thrown.  I guess this
isn't the case in C++, so maybe you need to check for null.  (However,
there maybe be valid uses of node which have a null edges reference, so
you'll have to check for it on use, not construction)

Martin Davis, Senior Technical Architect
Vivid Solutions Inc.      www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of [EMAIL PROTECTED]
> Sent: April 7, 2006 8:49 AM
> To: [EMAIL PROTECTED]
> Cc: geos-devel@geos.refractions.net
> Subject: [jts-devel] Node invariant
> 
> 
> I'm debugging memory instabilities in GEOS
> and came to a question about Node.
> 
> Node constructor in JTS takes an EdgeEndStar
> argument and assigns to this.edges.
> 
> Later on, this.edges is used as a fully
> constructed object [ see Node#add(EdgeEnd) ]
> 
> Does this mean that the given EdgeEndStar
> *must* be NOT NULL ? Or should Node#add(EdgeEnd)
> check for it ? Or isn't there anything such
> a NULL object in Java ?
> 
> --strk;
> 
>  /"\    ASCII Ribbon Campaign
>  \ /    Respect for low technology.
>   X     Keep e-mail messages readable by any computer system.
>  / \    Keep it ASCII. 
> 
> _______________________________________________
> jts-devel mailing list
> [EMAIL PROTECTED]
> http://lists.refractions.net/mailman/listinfo/jts-devel
> 
_______________________________________________
jts-devel mailing list
[EMAIL PROTECTED]
http://lists.refractions.net/mailman/listinfo/jts-devel
_______________________________________________
geos-devel mailing list
geos-devel@geos.refractions.net
http://geos.refractions.net/mailman/listinfo/geos-devel

Reply via email to