Sanity check (to return NONE) prevents null pointer exception on the switch() statment.

This commit is contained in:
Bryan Varner 2012-04-17 13:05:59 -04:00 committed by Strong Liu
parent 55de90ec42
commit 88e231f50b
1 changed files with 4 additions and 0 deletions

View File

@ -49,6 +49,10 @@ public enum CacheConcurrencyStrategy {
}
public static CacheConcurrencyStrategy fromAccessType(AccessType accessType) {
if (null == accessType) {
return NONE;
}
switch ( accessType ) {
case READ_ONLY: {
return READ_ONLY;