logo separator

[mkgmap-dev] final fields in Coord

From Steve Ratcliffe steve at parabola.me.uk on Mon Oct 28 21:10:00 GMT 2013

On 28/10/13 17:34, GerdP wrote:
> To do that I have to remove the final attribute from the latitude and
> longitude fields.
> Is that known to cause problems?

Coord is used as the key of a Map in lots of places.

If you change the lat or long then that also changes the hashCode and
will cause a bug whenever the Coord is changed between put() and or
get() on the Map.

While your change may not do that it, it becomes a bug waiting to
happen later on when someone else makes another change, so it is a bad
idea from that point of view.  I can see why you want to do it though.
Do you only need to move things that are really CoordNodes?

..Steve


More information about the mkgmap-dev mailing list