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

Fixed null-Globe bug in FlyToOrbitViewAnimator. #56

Closed wcmatthysen closed 5 years ago

wcmatthysen commented 5 years ago

Description of the Change

The Globe that is provided to the OnSurfacePositionAnimator's constructor could, in some situations, be null. This is especially true during startup when the View.goTo() method is called and the View.getGlobe() method returns null. As noted in the Javadocs, View.getGlobe() returns null if called before the first invocation of View.apply(). So then, instead of getting the Globe, and passing it on, the OrbitView itself is now passed along as constructor argument where the OnSurfacePositionAnimator can get the Globe, check if it is null or not and based on this determine whether it wants to try and get the endElevation at that point in time. If this fix is not done, the OnSurfacePositionAnimator could get stuck with a null Globe and will cause the entire application to break with NullPointerExceptions being printed out continually.

Why Should This Be In Core?

If this bugfix is not in, you can potentially end up with a broken Globe at startup.

Benefits

Stability improvements.

Potential Drawbacks

None

Applicable Issues

Issue #55

wcmatthysen commented 5 years ago

Ok, looks like the build is breaking because Travis can't properly install Oracle JDK 11.

gbburkhardt commented 5 years ago

My first thought is that GDALUtils should also be changed to avoid a long search through /usr/lib in the first place. No one will want to wait that long on a regular basis. So probably the search path for gdalplugins/gdal-data for Linux should change "/usr/lib" to "/usr/lib/gdalplugins".

gbburkhardt commented 5 years ago

Very nice. Good to go.