Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made StatusBar swing timer stoppable #234

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

paper-tiger
Copy link

Description of the Change

In the class gov.nasa.worldwind.util.StatusBar a SwingTimer is created as a local variable in the constructor. This way the timer can never be stopped.

Why Should This Be In Core?

Every Application which does not rely on System.exit() for its shutdown could have a problem with the timer mentioned above as the AWT Thread won't stop. Usage of System.exit() can be a problem if there are automated system tests executed by tools like the maven-failsafe-plugin, which does not allow for such calls.

Benefits

The timer can be stopped and applications can do a graceful shutdown.

Potential Drawbacks

There is the risk that a programmer calls the stop method and wonders why the network status is not updated anymore. It could even be argued that the encapsulation is broken but by using global state like the swing timer facility there is no other practical way to clean this up the way it is currently designed.

Applicable Issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant