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.
This is an example of the initial lite refactoring that I think we should start with to improve the stability and readability of Mesquite. I am new to the codebase so please let me know if I am missing something here
Heres a short summary of the changes made:
formatted using the default Eclipse formatting tools
This added
@Override
annotation and explicit imports, shortened some lines where it could, and formatted block comments. I think it is a good idea to use the default Eclipse formatting tools going forward to keep the codebase consistent, which makes it easier to readjavadoc comments
I've added javadoc comments to the methods so reading the code in an IDE or javadoc browser is easier. It appears that there is some convention with the long
/*---------*/
comments. I am not sure if these are used by an automatic documentation parser. I replaced them in favor of javadoc.Made the
beans
vector typedThis will ensure type safety at compile time so there are not any hidden/unexpected runtime errors. Generics are supported by everything including and after J2SE 5.0 which came out in 2004, so I think we will not have to worry about backwards compatibility in new releases
Flattened the code
There was a lot of unnecessary nesting which made the code harder to read. I removed the try catch blocks outside of run() because none of the functions they are calling throw any errors
I added a handler for the
InterruptionException
thrown byThread.sleep()
This will allow for the thread to shutdown gracefully if asked by the runtime.