[geos-devel] JTS equalsTopo()

Paul Ramsey pramsey at cleverelephant.ca
Thu Nov 29 16:06:34 PST 2018


On Thu, Nov 29, 2018 at 1:55 PM Martin Davis <mtnclimb at gmail.com> wrote:

> Hmmm... where are you seeing this "large retrofit"?
>

Admittedly, this was pretty non-scientific, I just did a global search for
it and found it in a number of classes more than would fit on one page...
:) so I knew it wasn't just one new method in Geometry.java that delegated
to equals() ... :)

Maybe it would all be fine'n'dandy. I'll look more closely tomorrow, if
it's only a few dozen locations, I'll just do it in the interests of
convergence.

P



>
> The confusion over equals VS equalsTopo is indeed a thing in the Java
> world, and equalsTopo was created to encourage being unambiguous about the
> intended meaning.  But in JTS equals just delegates to equalsTopo, and
> equals is still used all over the place in JTS code (equalsTopo - not so
> much).
>
> Actually equals is not used at all in the core code (since it's highly
> inefficient for low-level use).  It's used in the unit tests, where
> performance doesn't matter as much.  But even there it's mostly only used
> either where it is being tested, or in a somewhat casual way that should
> probably be replaced.
>
> So before opining about which way GEOS should go need to know more about
> where it's being used.
>
> On Thu, Nov 29, 2018 at 1:42 PM Paul Ramsey <pramsey at cleverelephant.ca>
> wrote:
>
>> Hrm... so, it seems at some point there was a large retrofit to flip
>> equals() to equalsTopo(). I assume that's because (if I recall right)
>> equals() has some special meaning/uses in the Java world, and having it
>> with a different meaning made some things (maps, I think?) not work.
>>
>> GEOS never made that flip, not having the same problem. On the one hand,
>> making the flip would potentially make future porting simpler (method names
>> would line up). On the other hand, it could be an error-prone and labour
>> intensive process... what's your feeling?
>>
>> P
>> _______________________________________________
>> geos-devel mailing list
>> geos-devel at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/geos-devel
>
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geos-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20181129/301a752a/attachment.html>


More information about the geos-devel mailing list