adrian/upm-swing — pull request #14 by MarkyV (2012-12-03 20:00:48+00:00)
Title: Added new Validator Class and Fixed Warnings

Hello,

This is only my second pull request on github as inspired by http://24pullrequests.com/ and that was how I found this project. Please do provide feedback if this is an appropriate request and if I'm doing anything wrong, but I hope I am helping out here, so thanks!

Each of my separate commits and documentation go into a little more more details, but basically, the ideas I am incorporating here are ingrained from my previous team's coding standards of rigorously preventing null pointer errors and not allowing warning counts to creep up a lot. My team used Google's Guava library (which are just awesome, check them out) to do Precondition (name of the class in Guava) checks on public arguments. Instead of bringing in a whole new dependency on Guava, I just added a "Validator" class that does the same concept and is much more light-weight. During our code reviews, these are items that we frequently comment on, so it's ingrained in me to always have code up to those standards.

This first pull request contains the new class as well as some fixes for a lot of warnings I see in eclipse, which are namely "does not specify SerialVersionUID" and a memory leak notice which I fixed by adding a finally. My next upcoming request will contain the implementation of argument checks, which will prevent NullPointers from occurring and instead provide a more helpful error message as to what went wrong which helps speed up debugging a lot and various other advantages as explained here: https://code.google.com/p/guava-libraries/wiki/UsingAndAvoidingNullExplained

Please let me know what you think and if this is acceptable, thanks!