[mkgmap-dev] final fields in Coord
From Gerd Petermann gpetermann_muenchen at hotmail.com on Mon Oct 28 21:21:49 GMT 2013
Hi Steve, > 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. OK, that seems to be a good argument against it, but on the other hand I think we always use IdentityHashMap because we want to find the same instance, not just an equal point, at least in StyledConverter (where I want to use the moveTo() method. > > 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? no, I am working on a new version of the frigRoundabout method. I think it works quite good, but I can change it to also use the replacements map like removeShortArcs. See attached patch. Missing: Code to make sure that an end-point of a way connected to a roundabout is not moved too much (creating a spike). Gerd -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20131028/94ea7577/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: frig-roundabouts-v1.patch Type: application/octet-stream Size: 6322 bytes Desc: not available URL: <http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20131028/94ea7577/attachment.obj>
- Previous message: [mkgmap-dev] final fields in Coord
- Next message: [mkgmap-dev] final fields in Coord
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the mkgmap-dev mailing list