barbeau / earth-gravitational-model

A lightweight port of the GeoTools EarthGravitationalModel (http://docs.geotools.org/latest/javadocs/org/geotools/referencing/operation/transform/EarthGravitationalModel.html).
GNU Lesser General Public License v2.1
17 stars 7 forks source link

Update EarthGravitationalModel.java #9

Closed marq24 closed 3 years ago

marq24 commented 3 years ago

since cr, sr, s11, s12 are used as global Temporary buffer (Allocated once for ever for avoiding too many objects creation / destruction) the heightOffset method is not thread save and need to be synchronized (in order to avoid that multiple threads will manipulate data in the cr, sr, s11, s12 double[] at the same time)...

Also I don't see any reason what could cause an Exception to be thown - so I removed it from the signature

barbeau commented 3 years ago

Thanks @marq24, good observations!