WorldWindEarth / WorldWindJava

A community supported fork of the NASA WorldWind Java SDK (WWJ) is for building cross-platform 3D geospatial desktop applications in Java.
https://worldwind.earth/WorldWindJava/
48 stars 14 forks source link

Compare key not value in SurfaceImageLayer #70

Closed twistedtwin closed 5 years ago

twistedtwin commented 5 years ago

Description of the Change

Change a check if an image path already exists to check against the key instead of the value in the map. ConcurrentHashMap.contains() calls containsValue(), which will never return true when passed a String.

Why Should This Be In Core?

It's a bug.

Benefits

If an image is added twice to a SurfaceImageLayer, the first one's tiles will be removed.

Potential Drawbacks

None that I can think of.

Applicable Issues

None created.

wcmatthysen commented 5 years ago

@twistedtwin, nicely spotted. This was most definitely a bug.

wcmatthysen commented 5 years ago

@Sufaev, @gbburkhardt, I think we can merge this into develop.