Derek White wrote:I don't understand why it is unsafe for the member to be accessed directly..
Is there some documentation for this?
It's not always unsafe and will depend on your implementation. There's the camp that believes that business logic belongs within the JavaBean. If that is the case, often times when setting or getting a property, business rules must be applied to them first. So there is additional logic in these mutator methods to achieve this. The other reason getters/setters are fairly common is because of libraries that work off JavaBeans and reflection like Hibernate, for example. Hibernate requires getters and setters for every persistent property of the object to work. This is also true many other libraries out in the java world.
There is actually quite a bit of debate regarding private/public variables and mutator methods. Googling and searching this site will provide more information. Unfortunately there isn't really a best practice. More often than not you are going to find yourself requiring getters/setters for various reasons.