We need to add a new type to the PolicyType enum called CUSTOM. The code in PolicyFactory which performs a lookup needs to return the CUSTOM type if policy name is not found in the _policies list.
The implementation of Policy for CUSTOM should be straightforward with the exception of the getType() method. This method appears to be used exclusively in our validation logic and I think it's going to be problematic for this use case. Returning null seems a bit hacky, as does adding a type of BOTH. Is the getType() method really necessary? If we need to keep something like PolicyType around, I suggest we change the method on policy to something like:
boolean supports(PolicyType type);
The existing calls to policy.getType() == PolicyType.INTERACTION can be changed to policy.supports(PolicyType.INTERACTION).
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira