-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #23309: NPE in GeoPropertyIndex$GPLevel.getBounded when called by…
… `Territories.getRegionalTaginfoUrls` `Territories.getRegionalTaginfoUrls` uses `Collection.parallelStream` which could cause the following race conditions: * `children` is reinitialized after the `null` check, potentially causing an NPE due to a different `null` check becoming `false` after it was checked. Solution: either synchronize the creation of `children` or have a local variable. * Two threads could generate a child and then generate children of children, creating a split tree hierarchy, only one of which would be kept. Solution: synchronize the creation of the child nodes For both of the new `synchronized` methods, we ''could'' use a safe double-lock idiom if there ends up being performance issues. This probably won't be the case. Profiling JOSM start to end with Mesa County, CO (+ validations) did not show that the modified methods were "hot". This additionally fixes some lint issues and converts some package-private methods to use `ILatLon` instead of `LatLon`. git-svn-id: https://josm.openstreetmap.de/svn/trunk@18903 0c6e7542-c601-0410-84e7-c038aed88b3b
- Loading branch information
taylor.smock
committed
Nov 22, 2023
1 parent
6a768d5
commit f26beee
Showing
1 changed file
with
82 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters