Fixed null-Globe bug in FlyToOrbitViewAnimator.#56
Merged
wcmatthysen merged 2 commits intoWorldWindEarth:developfrom Jun 29, 2019
wcmatthysen:fly-to-orbit-null-globe-fix
Merged
Fixed null-Globe bug in FlyToOrbitViewAnimator.#56wcmatthysen merged 2 commits intoWorldWindEarth:developfrom wcmatthysen:fly-to-orbit-null-globe-fix
wcmatthysen merged 2 commits intoWorldWindEarth:developfrom
wcmatthysen:fly-to-orbit-null-globe-fix
Conversation
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.
Member
Author
|
Ok, looks like the build is breaking because Travis can't properly install Oracle JDK 11. |
Member
|
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". |
Modified `FlyToOrbitViewAnimator` by removing the null `Globe` check from the `nextPosition()` method of the `OnSurfacePositionAnimator` inner class. This null-check is not needed as the `Globe` should be non-null when this method is called the first time.
Member
|
Very nice. Good to go. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
The
Globethat is provided to theOnSurfacePositionAnimator'sconstructor could, in some situations, be null. This is especially true during startup when theView.goTo()method is called and theView.getGlobe()method returns null. As noted in the Javadocs,View.getGlobe()returns null if called before the first invocation ofView.apply(). So then, instead of getting theGlobe, and passing it on, theOrbitViewitself is now passed along as constructor argument where theOnSurfacePositionAnimatorcan get theGlobe, check if it is null or not and based on this determine whether it wants to try and get theendElevationat that point in time. If this fix is not done, theOnSurfacePositionAnimatorcould get stuck with a nullGlobeand will cause the entire application to break withNullPointerExceptionsbeing 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