sergiogonzalez/liferay-portal — pull request #586 by shuyangzhou (2013-02-01 09:29:34+00:00)
Title: Lps 32723

Two things are different from what we talked about.
1) MembershipPolicyFactory is using Spring to initialize.
I still feel this class should be called MembershipPolicyUtil, as it is simply a holder. But anyway, that is not a big deal.
2) NPE checking inside GroupLocalServiceImpl.checkMembershipPolicy() and UserGroupRoleLocalServiceImpl.checkMembershipPolicy()
This check is technically not needed, as on using a null, jvm throws NPE anyway, but throwing it by ourselves can have a message inside.
We should not to refetch here, as pass in null is a wrong api usage, we should push it back to the caller, rather than hide it by using default, since we don't know for sure whether there is a default policy or not.