Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Made StatusBar swing timer stoppable #234

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

Open
paper-tiger wants to merge 1 commit into NASAWorldWind:develop
base: develop
Choose a base branch
Loading
from paper-tiger:develop

Conversation

Copy link

@paper-tiger paper-tiger commented Nov 9, 2021

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

PJHogan reacted with rocket emoji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /