Iteration Two Proposal - Paul-Schliep/CraftBukkit GitHub Wiki
Prioritized list of refactorings
Below are our prioritized list of refactorings. Our initial plan is to tackle these in this order, but we may need to revise that plan as we move into the refactorings.
You probably want to remove all my italicized "instructional" text as you work through the proposal.
Make sure to commit frequently as you work. At a minimum you should commit after completing each refactoring so you can document that accomplishment in your commit message. For more complex refactorings you'll probably want/need to commit multiple times as you go.
Refactoring 0: Long Method
Issue/bad smell being addressed
There is a monstrously long if/else chain in CraftEntity. We plan to use polymorphism to reduce a fair chunk of it.
Planned refactoring
We plan to add a getEntity() method within all the entity classes (EntityChicken, EntityZombie, etc), so that in CraftEntity, we can simply make a entity.getEntity() call after an appropriate check.
Technical difficulty
We've never tried polymorphism before, so we imagine that this could be quite difficult, but we're willing to try!
Impact on the code
This should drastically reduce the complexity as well as improve the readability for the class.
Outcomes
For each refactoring you did, summarize the outcome. How difficult did the refactoring turn out to be? What was its overall impact? Are there new doors that this refactoring opened?
##Refactoring 0 This worked well after Eclipse decided to play nice when it came to declaring/handling static methods. We drastically shortened the animal and monster sections of that horrible if/else chain. It did require a LOT of shotgun surgery. Thankfully though, we only needed to add one short method, of the same form, to a bunch of classes, so it wasn't very difficult. However, we did modify a bunch of files in the net.server package, so none of this would be good to try to pull back to CraftBukkit, but we learned a lot from it, so we don't care.