Skip to content

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