-
Notifications
You must be signed in to change notification settings - Fork 142
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
Refactor for ControllerGroup + synchronized #73
Open
GoToLoop
wants to merge
13
commits into
sojamo:master
Choose a base branch
from
GoToLoop:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
* I wasn't expecting almost 1000 lines of code, but I've taken the challenge anyways. * Placed localized `synchronized ()` not only for those 2 _**Vector**_ containers from _controllers_ field, but also for the 2 __*ArrayList*__ in __*ControllerGroup*__ class. * Mostly for all sections doing iteration on them, but also when their **size()** changes. * Prepended `@Override` for all inherited methods in __*ControllerGroup*__ class. * Prepended `final` for all fields which didn't seem they would be re-assigned. * Lotsa further cleanups I can't remember I did. :P
Since __*ArrayList*__ isn't safe like __*Vector*__, I'm also adding `synchronized ()` at places where either of its structure's **size()** changes. Those 6 methods are: **add()**, **addDrawable()**, **remove()**, **removeDrawable()**, **clear()** and **clearDrawable()**. Of course, all loops traversing this class still needs to be synchronized externally as well; either over **get()** or **getDrawables()**. Last word: This patch is just a standalone performant refactoring. It's not obligatory for __*ControllerGroup*__'s previous patch.
Change Vector to ArrayList
Revert "Change Vector to ArrayList"
ControllerGroup< ? extends ControllerGroup< ? > >
Initialize _**String**_ fields w/ an empty `""`.
`float[]` to `float...`.
Hi @GoToLoop thank you for looking into this however I wont include your suggestions or fix the issue after I have reviewed and evaluated the concurrency issues. I hope you don't mind I close your pull requests. |
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.
synchronized ()
not only for those 2 Vector containers from controllers field, but also for the 2 ArrayList in ControllerGroup class.@Override
for all inherited methods in ControllerGroup class.final
for all fields which didn't seem they would be re-assigned.