ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [2/2] ranger git commit: code cleanup in the security admin module - fix string comparisons
Date Wed, 05 Apr 2017 16:36:28 GMT
code cleanup in the security admin module - fix string comparisons

Change-Id: Ic76336bae0a6b7c05fe1820a1ba05f345b4a66db

Signed-off-by: Colm O hEigeartaigh <coheigea@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/1d18e76d
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/1d18e76d
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/1d18e76d

Branch: refs/heads/master
Commit: 1d18e76dacc9326419855c7881ef79cf60f19a61
Parents: cdde1b6
Author: Zsombor Gegesy <gzsombor@gmail.com>
Authored: Sun Apr 2 18:25:15 2017 +0200
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Wed Apr 5 17:36:20 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/ranger/biz/AssetMgr.java    |  16 +--
 .../java/org/apache/ranger/biz/KmsKeyMgr.java   |   2 +-
 .../org/apache/ranger/biz/RangerBizUtil.java    |  34 +++---
 .../org/apache/ranger/biz/ServiceDBStore.java   |   6 +-
 .../java/org/apache/ranger/biz/ServiceMgr.java  |  10 +-
 .../java/org/apache/ranger/biz/SessionMgr.java  |   2 +-
 .../java/org/apache/ranger/biz/XAuditMgr.java   |   4 +-
 .../org/apache/ranger/common/AppConstants.java  | 102 +++++++++---------
 .../apache/ranger/common/PropertiesUtil.java    |  16 +--
 .../apache/ranger/common/RangerSearchUtil.java  |  10 +-
 .../org/apache/ranger/common/SearchGroup.java   |   4 +-
 .../org/apache/ranger/common/SearchUtil.java    |  16 ++-
 .../org/apache/ranger/common/ServiceUtil.java   |  38 +++----
 .../org/apache/ranger/common/StringUtil.java    |   2 +-
 .../org/apache/ranger/db/RangerDaoManager.java  |   2 +-
 .../apache/ranger/db/RangerDaoManagerBase.java  | 108 +++++++++----------
 .../apache/ranger/entity/XXAccessAuditBase.java |   4 +-
 .../java/org/apache/ranger/entity/XXAsset.java  |   4 +-
 .../org/apache/ranger/entity/XXAuditMap.java    |   2 +-
 .../org/apache/ranger/entity/XXAuthSession.java |   8 +-
 .../java/org/apache/ranger/entity/XXGroup.java  |   4 +-
 .../org/apache/ranger/entity/XXPermMap.java     |   6 +-
 .../org/apache/ranger/entity/XXPortalUser.java  |   4 +-
 .../apache/ranger/entity/XXPortalUserRole.java  |   2 +-
 .../org/apache/ranger/entity/XXResource.java    |  14 +--
 .../java/org/apache/ranger/entity/XXTrxLog.java |   2 +-
 .../java/org/apache/ranger/entity/XXUser.java   |   2 +-
 .../patch/cliutil/DbToSolrMigrationUtil.java    |   8 +-
 .../apache/ranger/patch/cliutil/MetricUtil.java |   4 +-
 .../org/apache/ranger/rest/ServiceREST.java     |  10 +-
 .../handler/RangerAuthenticationProvider.java   |   8 +-
 .../RangerAuthFailureHandler.java               |   6 +-
 .../RangerAuthSuccessHandler.java               |   2 +-
 .../RangerAuthenticationEntryPoint.java         |   2 +-
 .../filter/RangerKRBAuthenticationFilter.java   |   8 +-
 .../security/web/filter/RangerKrbFilter.java    |   2 +-
 .../filter/RangerSSOAuthenticationFilter.java   |   2 +-
 .../service/AbstractBaseResourceService.java    |  20 ++--
 .../ranger/service/RangerPolicyService.java     |  66 ++++++------
 .../ranger/service/RangerServiceService.java    |   6 +-
 .../apache/ranger/service/XAssetService.java    |  17 ++-
 .../apache/ranger/service/XAuditMapService.java |   8 +-
 .../apache/ranger/service/XGroupService.java    |   8 +-
 .../ranger/service/XGroupUserService.java       |   6 +-
 .../apache/ranger/service/XPermMapService.java  |  20 ++--
 .../ranger/service/XPortalUserService.java      |  10 +-
 .../apache/ranger/service/XResourceService.java |  16 +--
 .../org/apache/ranger/service/XUserService.java |  22 ++--
 .../service/filter/RangerRESTAPIFilter.java     |   6 +-
 .../java/org/apache/ranger/solr/SolrMgr.java    |  10 +-
 .../java/org/apache/ranger/solr/SolrUtil.java   |   2 +-
 .../java/org/apache/ranger/util/RestUtil.java   |   2 +-
 52 files changed, 342 insertions(+), 353 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/biz/AssetMgr.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/biz/AssetMgr.java b/security-admin/src/main/java/org/apache/ranger/biz/AssetMgr.java
index 9244cd6..01062de 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/AssetMgr.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/AssetMgr.java
@@ -149,7 +149,7 @@ public class AssetMgr extends AssetMgrBase {
 		File file = null;
 		try {
 			if (fileType != null) {
-				if (fileType.equalsIgnoreCase("json")) {
+				if ("json".equalsIgnoreCase(fileType)) {
 					file = jsonUtil.writeJsonToFile(xResource,
 							xResource.getName());
 				} else {
@@ -211,7 +211,7 @@ public class AssetMgr extends AssetMgrBase {
 
 		policyExportAudit.setClientIP(ipAddress);
 
-		if (epoch != null && !epoch.trim().isEmpty() && !epoch.equalsIgnoreCase("null")) {
+		if (epoch != null && !epoch.trim().isEmpty() && !"null".equalsIgnoreCase(epoch)) {
 			policyExportAudit.setRequestedEpoch(Long.parseLong(epoch));
 		} else {
 			policyExportAudit.setRequestedEpoch(0L);
@@ -253,7 +253,7 @@ public class AssetMgr extends AssetMgrBase {
 			try {
 				LdapName ln = new LdapName(dn);
 				for (Rdn rdn : ln.getRdns()) {
-					if (rdn.getType().equalsIgnoreCase("CN")) {
+					if ("CN".equalsIgnoreCase(rdn.getType())) {
 						commonName = rdn.getValue() + "";
 						break;
 					}
@@ -976,10 +976,10 @@ public class AssetMgr extends AssetMgrBase {
         }
         if (searchCriteria.getSortType() == null) {
             searchCriteria.setSortType("desc");
-        } else if (!searchCriteria.getSortType().equalsIgnoreCase("asc") && !searchCriteria.getSortType().equalsIgnoreCase("desc")) {
+        } else if (!"asc".equalsIgnoreCase(searchCriteria.getSortType()) && !"desc".equalsIgnoreCase(searchCriteria.getSortType())) {
             searchCriteria.setSortType("desc");
         }
-        if (xaBizUtil.getAuditDBType().equalsIgnoreCase(RangerBizUtil.AUDIT_STORE_SOLR)) {
+        if (RangerBizUtil.AUDIT_STORE_SOLR.equalsIgnoreCase(xaBizUtil.getAuditDBType())) {
             return solrAccessAuditsService.searchXAccessAudits(searchCriteria);
         } else {
             return xAccessAuditService.searchXAccessAudits(searchCriteria);
@@ -1007,14 +1007,14 @@ public class AssetMgr extends AssetMgrBase {
 		for (VXTrxLog xTrxLog : xTrxLogList) {
 			VXTrxLog vXTrxLog = new VXTrxLog();
 			vXTrxLog = xTrxLog;
-			if(vXTrxLog.getPreviousValue()==null || vXTrxLog.getPreviousValue().equalsIgnoreCase("null")){
+			if(vXTrxLog.getPreviousValue()==null || "null".equalsIgnoreCase(vXTrxLog.getPreviousValue())){
 				vXTrxLog.setPreviousValue("");
 			}
-			if(vXTrxLog.getAttributeName()!=null && vXTrxLog.getAttributeName().equalsIgnoreCase("Password")){
+			if(vXTrxLog.getAttributeName()!=null && "Password".equalsIgnoreCase(vXTrxLog.getAttributeName())){
 				vXTrxLog.setPreviousValue("*********");
 				vXTrxLog.setNewValue("***********");
 			}
-			if(vXTrxLog.getAttributeName()!=null && vXTrxLog.getAttributeName().equalsIgnoreCase("Connection Configurations")){
+			if(vXTrxLog.getAttributeName()!=null && "Connection Configurations".equalsIgnoreCase(vXTrxLog.getAttributeName())){
 				if(vXTrxLog.getPreviousValue()!=null && vXTrxLog.getPreviousValue().contains("password")){
 					String tempPreviousStr=vXTrxLog.getPreviousValue();					
 					String tempPreviousArr[]=vXTrxLog.getPreviousValue().split(",");					

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/biz/KmsKeyMgr.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/biz/KmsKeyMgr.java b/security-admin/src/main/java/org/apache/ranger/biz/KmsKeyMgr.java
index 924aaa9..03bcb60 100755
--- a/security-admin/src/main/java/org/apache/ranger/biz/KmsKeyMgr.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/KmsKeyMgr.java
@@ -587,7 +587,7 @@ public class KmsKeyMgr {
 	}
 
 	private boolean checkKerberos() throws Exception {
-		if(PropertiesUtil.getProperty(RANGER_AUTH_TYPE, "simple").equalsIgnoreCase(KERBEROS_TYPE)){
+		if(KERBEROS_TYPE.equalsIgnoreCase(PropertiesUtil.getProperty(RANGER_AUTH_TYPE, "simple"))){
 			return true;
 		}else{
 			return false;

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/biz/RangerBizUtil.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/biz/RangerBizUtil.java b/security-admin/src/main/java/org/apache/ranger/biz/RangerBizUtil.java
index cceb380..efc308a 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/RangerBizUtil.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/RangerBizUtil.java
@@ -172,12 +172,12 @@ public class RangerBizUtil {
 	 * @return
 	 */
 	public int getMimeTypeInt(String contentType) {
-		if (contentType.equalsIgnoreCase("JPEG")
-				|| contentType.equalsIgnoreCase("JPG")
+		if ("JPEG".equalsIgnoreCase(contentType)
+				|| "JPG".equalsIgnoreCase(contentType)
 				|| contentType.endsWith("jpg") || contentType.endsWith("jpeg")) {
 			return RangerConstants.MIME_JPEG;
 		}
-		if (contentType.equalsIgnoreCase("PNG") || contentType.endsWith("png")) {
+		if ("PNG".equalsIgnoreCase(contentType) || contentType.endsWith("png")) {
 			return RangerConstants.MIME_PNG;
 		}
 		return RangerConstants.MIME_UNKNOWN;
@@ -880,11 +880,11 @@ public class RangerBizUtil {
 			// if permission is enabled then load Topologies,services list from
 			// resource
 			if (hasPermission) {
-				String[] xTopologies = (xResource.getTopologies() == null || xResource
-						.getTopologies().equalsIgnoreCase("")) ? null
+				String[] xTopologies = (xResource.getTopologies() == null || "".equalsIgnoreCase(xResource
+						.getTopologies())) ? null
 						: stringUtil.split(xResource.getTopologies(), ",");
-				String[] xServices = (xResource.getServices() == null || xResource
-						.getServices().equalsIgnoreCase("")) ? null
+				String[] xServices = (xResource.getServices() == null || "".equalsIgnoreCase(xResource
+						.getServices())) ? null
 						: stringUtil.split(xResource.getServices(), ",");
 
 				boolean matchFound = false;
@@ -967,8 +967,8 @@ public class RangerBizUtil {
 			// if permission is enabled then load Topologies,services list from
 			// resource
 			if (hasPermission) {
-				String[] xTopologies = (xResource.getTopologies() == null || xResource
-						.getTopologies().equalsIgnoreCase("")) ? null
+				String[] xTopologies = (xResource.getTopologies() == null || "".equalsIgnoreCase(xResource
+						.getTopologies())) ? null
 						: stringUtil.split(xResource.getTopologies(), ",");
 				/*
 				 * String[] xServices = (xResource.getServices() == null ||
@@ -1453,9 +1453,9 @@ public class RangerBizUtil {
 				return false;
 			}
 
-			if (isKeyAdmin && implClass.equals(EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME)) {
+			if (isKeyAdmin && EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME.equals(implClass)) {
 				return true;
-			} else if ((isSysAdmin || isUser) && !implClass.equals(EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME)) {
+			} else if ((isSysAdmin || isUser) && !EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME.equals(implClass)) {
 				return true;
 			}
 		}
@@ -1475,9 +1475,9 @@ public class RangerBizUtil {
 				return false;
 			}
 
-			if (isKeyAdmin && implClass.equals(EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME)) {
+			if (isKeyAdmin && EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME.equals(implClass)) {
 				return true;
-			} else if (isUser && !implClass.equals(EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME)) {
+			} else if (isUser && !EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME.equals(implClass)) {
 				return true;
 			}
 			// else if ((isSysAdmin || isUser) && !implClass.equals(EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME)) {
@@ -1506,7 +1506,7 @@ public class RangerBizUtil {
 	public void hasKMSPermissions(String objType, String implClassName) {
 		UserSessionBase session = ContextUtil.getCurrentUserSession();
 
-		if (session.isKeyAdmin() && !implClassName.equals(EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME)) {
+		if (session.isKeyAdmin() && !EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME.equals(implClassName)) {
 			throw restErrorUtil.createRESTException("KeyAdmin can create/update/delete only KMS " + objType,
 					MessageEnums.OPER_NO_PERMISSION);
 		}
@@ -1514,7 +1514,7 @@ public class RangerBizUtil {
 		// TODO: As of now we are allowing SYS_ADMIN to create/update/read/delete all the
 		// services including KMS
 
-		if (objType.equalsIgnoreCase("Service-Def") && session.isUserAdmin() && implClassName.equals(EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME)) {
+		if ("Service-Def".equalsIgnoreCase(objType) && session.isUserAdmin() && EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME.equals(implClassName)) {
 			throw restErrorUtil.createRESTException("System Admin cannot create/update/delete KMS " + objType,
 					MessageEnums.OPER_NO_PERMISSION);
 		}
@@ -1557,7 +1557,7 @@ public class RangerBizUtil {
 			String[] userList = userNames.split(",");
 			if(userList != null){
 				for (String u : userList) {
-					if (u.equals("*") || (user != null && u.equalsIgnoreCase(user))) {
+					if ("*".equals(u) || (user != null && u.equalsIgnoreCase(user))) {
 						return true;
 					}
 				}
@@ -1575,7 +1575,7 @@ public class RangerBizUtil {
 			String[] userList = userNames.split(",");
 			if (userList != null) {
 				for (String u : userList) {
-					if (u.equals("*") || (userName != null && u.equalsIgnoreCase(userName))) {
+					if ("*".equals(u) || (userName != null && u.equalsIgnoreCase(userName))) {
 						return true;
 					}
 				}

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java b/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
index b882488..986c37e 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
@@ -1508,7 +1508,7 @@ public class ServiceDBStore extends AbstractServiceStore {
 		if (StringUtils.isNotBlank(newTagServiceName)) {
 			RangerService tmp = getServiceByName(newTagServiceName);
 
-			if (tmp == null || !tmp.getType().equals(EmbeddedServiceDefsUtil.EMBEDDED_SERVICEDEF_TAG_NAME)) {
+			if (tmp == null || !EmbeddedServiceDefsUtil.EMBEDDED_SERVICEDEF_TAG_NAME.equals(tmp.getType())) {
 				if (LOG.isDebugEnabled()) {
 					LOG.debug("ServiceDBStore.updateService() - " + newTagServiceName + " does not refer to a valid tag service.(" + service + ")");
 				}
@@ -1879,7 +1879,7 @@ public class ServiceDBStore extends AbstractServiceStore {
 		updatePolicySignature(policy);
 
 		boolean isTagVersionUpdateNeeded = false;
-		if (service.getType().equals(EmbeddedServiceDefsUtil.EMBEDDED_SERVICEDEF_TAG_NAME)) {
+		if (EmbeddedServiceDefsUtil.EMBEDDED_SERVICEDEF_TAG_NAME.equals(service.getType())) {
 			isTagVersionUpdateNeeded = existing.getIsEnabled() ? !policy.getIsEnabled() : policy.getIsEnabled();
 			isTagVersionUpdateNeeded = isTagVersionUpdateNeeded || !StringUtils.equals(existing.getResourceSignature(), policy.getResourceSignature());
 		}
@@ -3783,7 +3783,7 @@ public class ServiceDBStore extends AbstractServiceStore {
 							rangerService.getConfigs().put(ServiceREST.Allowed_User_List_For_Download, serviceUser);
 							chkServiceUpdate = true;
 		                }
-		                if((!rangerService.getConfigs().containsKey(ServiceREST.Allowed_User_List_For_Grant_Revoke)) && (rangerService.getType().equalsIgnoreCase("hbase") || rangerService.getType().equalsIgnoreCase("hive"))){
+		                if((!rangerService.getConfigs().containsKey(ServiceREST.Allowed_User_List_For_Grant_Revoke)) && ("hbase".equalsIgnoreCase(rangerService.getType()) || "hive".equalsIgnoreCase(rangerService.getType()))){
 							rangerService.getConfigs().put(ServiceREST.Allowed_User_List_For_Grant_Revoke, serviceUser);
 							chkServiceUpdate = true;
 		                }

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/biz/ServiceMgr.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/biz/ServiceMgr.java b/security-admin/src/main/java/org/apache/ranger/biz/ServiceMgr.java
index f2b8f99..722a566 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/ServiceMgr.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/ServiceMgr.java
@@ -90,7 +90,7 @@ public class ServiceMgr {
 		String rangerPrincipal = SecureClientLogin.getPrincipal(PropertiesUtil.getProperty(ADMIN_USER_PRINCIPAL), PropertiesUtil.getProperty(HOST_NAME));
 		String rangerkeytab = PropertiesUtil.getProperty(ADMIN_USER_KEYTAB);
 		
-		if(!StringUtils.isEmpty(authType) && authType.trim().equalsIgnoreCase(KERBEROS_TYPE) && SecureClientLogin.isKerberosCredentialExists(lookupPrincipal, lookupKeytab)){
+		if(!StringUtils.isEmpty(authType) && KERBEROS_TYPE.equalsIgnoreCase(authType.trim()) && SecureClientLogin.isKerberosCredentialExists(lookupPrincipal, lookupKeytab)){
 			if(service != null && service.getConfigs() != null){
 				service.getConfigs().put(HadoopConfigHolder.RANGER_LOOKUP_PRINCIPAL, lookupPrincipal);
 				service.getConfigs().put(HadoopConfigHolder.RANGER_LOOKUP_KEYTAB, lookupKeytab);
@@ -98,7 +98,7 @@ public class ServiceMgr {
 				service.getConfigs().put(HadoopConfigHolder.RANGER_AUTH_TYPE, authType);				
 			}
 		}
-		if(!StringUtils.isEmpty(authType) && authType.trim().equalsIgnoreCase(KERBEROS_TYPE) && SecureClientLogin.isKerberosCredentialExists(rangerPrincipal, rangerkeytab)){
+		if(!StringUtils.isEmpty(authType) && KERBEROS_TYPE.equalsIgnoreCase(authType.trim()) && SecureClientLogin.isKerberosCredentialExists(rangerPrincipal, rangerkeytab)){
 			if(service != null && service.getConfigs() != null){
 				service.getConfigs().put(HadoopConfigHolder.RANGER_PRINCIPAL, rangerPrincipal);
 				service.getConfigs().put(HadoopConfigHolder.RANGER_KEYTAB, rangerkeytab);
@@ -143,7 +143,7 @@ public class ServiceMgr {
 		String rangerPrincipal = SecureClientLogin.getPrincipal(PropertiesUtil.getProperty(ADMIN_USER_PRINCIPAL), PropertiesUtil.getProperty(HOST_NAME));
 		String rangerkeytab = PropertiesUtil.getProperty(ADMIN_USER_KEYTAB);
 		
-		if(!StringUtils.isEmpty(authType) && authType.trim().equalsIgnoreCase(KERBEROS_TYPE) && SecureClientLogin.isKerberosCredentialExists(lookupPrincipal, lookupKeytab)){
+		if(!StringUtils.isEmpty(authType) && KERBEROS_TYPE.equalsIgnoreCase(authType.trim()) && SecureClientLogin.isKerberosCredentialExists(lookupPrincipal, lookupKeytab)){
 			if(service != null && service.getConfigs() != null){
 				service.getConfigs().put(HadoopConfigHolder.RANGER_LOOKUP_PRINCIPAL, lookupPrincipal);
 				service.getConfigs().put(HadoopConfigHolder.RANGER_LOOKUP_KEYTAB, lookupKeytab);
@@ -151,7 +151,7 @@ public class ServiceMgr {
 				service.getConfigs().put(HadoopConfigHolder.RANGER_AUTH_TYPE, authType);
 			}
 		}
-		if(!StringUtils.isEmpty(authType) && authType.trim().equalsIgnoreCase(KERBEROS_TYPE) && SecureClientLogin.isKerberosCredentialExists(rangerPrincipal, rangerkeytab)){
+		if(!StringUtils.isEmpty(authType) && KERBEROS_TYPE.equalsIgnoreCase(authType.trim()) && SecureClientLogin.isKerberosCredentialExists(rangerPrincipal, rangerkeytab)){
 			if(service != null && service.getConfigs() != null){
 				service.getConfigs().put(HadoopConfigHolder.RANGER_PRINCIPAL, rangerPrincipal);
 				service.getConfigs().put(HadoopConfigHolder.RANGER_KEYTAB, rangerkeytab);
@@ -343,7 +343,7 @@ public class ServiceMgr {
 
 		URL pluginJarPath = getClass().getClassLoader().getResource(dirPath);
 
-		if(pluginJarPath != null && pluginJarPath.getProtocol().equals("file")) {
+		if(pluginJarPath != null && "file".equals(pluginJarPath.getProtocol())) {
 			try {
 				File[] dirFiles = new File(pluginJarPath.toURI()).listFiles();
 

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/biz/SessionMgr.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/biz/SessionMgr.java b/security-admin/src/main/java/org/apache/ranger/biz/SessionMgr.java
index 0122e6b..9eb8f1f 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/SessionMgr.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/SessionMgr.java
@@ -267,7 +267,7 @@ public class SessionMgr {
 		} else if (strRoleList.contains(RangerConstants.ROLE_KEY_ADMIN)) {
 			userSession.setKeyAdmin(true);
 			userSession.setUserAdmin(false);
-		} else if (strRoleList.size() == 1 && strRoleList.get(0).equals(RangerConstants.ROLE_USER)) {
+		} else if (strRoleList.size() == 1 && RangerConstants.ROLE_USER.equals(strRoleList.get(0))) {
 			userSession.setKeyAdmin(false);
 			userSession.setUserAdmin(false);
 		}

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/biz/XAuditMgr.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/biz/XAuditMgr.java b/security-admin/src/main/java/org/apache/ranger/biz/XAuditMgr.java
index 3542da2..c2fac0b 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/XAuditMgr.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/XAuditMgr.java
@@ -105,7 +105,7 @@ public class XAuditMgr extends XAuditMgrBase {
 
 	@Override
 	public VXAccessAuditList searchXAccessAudits(SearchCriteria searchCriteria) {
-		if (rangerBizUtil.getAuditDBType().equalsIgnoreCase("solr")) {
+		if ("solr".equalsIgnoreCase(rangerBizUtil.getAuditDBType())) {
 			return solrAccessAuditsService.searchXAccessAudits(searchCriteria);
 		} else {
 			return super.searchXAccessAudits(searchCriteria);
@@ -114,7 +114,7 @@ public class XAuditMgr extends XAuditMgrBase {
 
 	@Override
 	public VXLong getXAccessAuditSearchCount(SearchCriteria searchCriteria) {
-		if (rangerBizUtil.getAuditDBType().equalsIgnoreCase("solr")) {
+		if ("solr".equalsIgnoreCase(rangerBizUtil.getAuditDBType())) {
 			return solrAccessAuditsService.getXAccessAuditSearchCount(searchCriteria);
 		} else {
 			return super.getXAccessAuditSearchCount(searchCriteria);

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/common/AppConstants.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/common/AppConstants.java b/security-admin/src/main/java/org/apache/ranger/common/AppConstants.java
index 39d28a1..4a02e26 100644
--- a/security-admin/src/main/java/org/apache/ranger/common/AppConstants.java
+++ b/security-admin/src/main/java/org/apache/ranger/common/AppConstants.java
@@ -975,22 +975,22 @@ public class AppConstants extends RangerCommonEnums {
 		if (label == null) {
 			return 0;
 		}
-		if (label.equalsIgnoreCase("Unknown")) {
+		if ("Unknown".equalsIgnoreCase(label)) {
 			return AppConstants.ASSET_UNKNOWN; // ASSET_UNKNOWN
 		}
-		if (label.equalsIgnoreCase("HDFS")) {
+		if ("HDFS".equalsIgnoreCase(label)) {
 			return AppConstants.ASSET_HDFS; // ASSET_HDFS
 		}
-		if (label.equalsIgnoreCase("HBase")) {
+		if ("HBase".equalsIgnoreCase(label)) {
 			return AppConstants.ASSET_HBASE; // ASSET_HBASE
 		}
-		if (label.equalsIgnoreCase("Hive")) {
+		if ("Hive".equalsIgnoreCase(label)) {
 			return AppConstants.ASSET_HIVE; // ASSET_HIVE
 		}
-		if (label.equalsIgnoreCase("Knox")) {
+		if ("Knox".equalsIgnoreCase(label)) {
 			return AppConstants.ASSET_KNOX; // ASSET_KNOX
 		}
-		if (label.equalsIgnoreCase("Storm")) {
+		if ("Storm".equalsIgnoreCase(label)) {
 			return AppConstants.ASSET_STORM; // ASSET_STORM
 		}
 		return 0;
@@ -1018,37 +1018,37 @@ public class AppConstants extends RangerCommonEnums {
 		if (label == null) {
 			return 0;
 		}
-		if (label.equalsIgnoreCase("Unknown")) {
+		if ("Unknown".equalsIgnoreCase(label)) {
 			return AppConstants.RESOURCE_UNKNOWN; // RESOURCE_UNKNOWN
 		}
-		if (label.equalsIgnoreCase("Path")) {
+		if ("Path".equalsIgnoreCase(label)) {
 			return AppConstants.RESOURCE_PATH; // RESOURCE_PATH
 		}
-		if (label.equalsIgnoreCase("Database")) {
+		if ("Database".equalsIgnoreCase(label)) {
 			return AppConstants.RESOURCE_DB; // RESOURCE_DB
 		}
-		if (label.equalsIgnoreCase("Table")) {
+		if ("Table".equalsIgnoreCase(label)) {
 			return AppConstants.RESOURCE_TABLE; // RESOURCE_TABLE
 		}
-		if (label.equalsIgnoreCase("Column Family")) {
+		if ("Column Family".equalsIgnoreCase(label)) {
 			return AppConstants.RESOURCE_COL_FAM; // RESOURCE_COL_FAM
 		}
-		if (label.equalsIgnoreCase("Column")) {
+		if ("Column".equalsIgnoreCase(label)) {
 			return AppConstants.RESOURCE_COLUMN; // RESOURCE_COLUMN
 		}
-		if (label.equalsIgnoreCase("VIEW")) {
+		if ("VIEW".equalsIgnoreCase(label)) {
 			return AppConstants.RESOURCE_VIEW; // RESOURCE_VIEW
 		}
-		if (label.equalsIgnoreCase("UDF")) {
+		if ("UDF".equalsIgnoreCase(label)) {
 			return AppConstants.RESOURCE_UDF; // RESOURCE_UDF
 		}
-		if (label.equalsIgnoreCase("View Column")) {
+		if ("View Column".equalsIgnoreCase(label)) {
 			return AppConstants.RESOURCE_VIEW_COL; // RESOURCE_VIEW_COL
 		}
-		if (label.equalsIgnoreCase("Topology")) {
+		if ("Topology".equalsIgnoreCase(label)) {
 			return AppConstants.RESOURCE_TOPOLOGY; // RESOURCE_TOPOLOGY
 		}
-		if (label.equalsIgnoreCase("Service")) {
+		if ("Service".equalsIgnoreCase(label)) {
 			return AppConstants.RESOURCE_SERVICE_NAME; // RESOURCE_SERVICE_NAME
 		}
 		return 0;
@@ -1058,100 +1058,100 @@ public class AppConstants extends RangerCommonEnums {
 		if (label == null) {
 			return 0;
 		}
-		if (label.equalsIgnoreCase("Unknown")) {
+		if ("Unknown".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_UNKNOWN; // XA_PERM_TYPE_UNKNOWN
 		}
-		if (label.equalsIgnoreCase("Reset")) {
+		if ("Reset".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_RESET; // XA_PERM_TYPE_RESET
 		}
-		if (label.equalsIgnoreCase("Read")) {
+		if ("Read".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_READ; // XA_PERM_TYPE_READ
 		}
-		if (label.equalsIgnoreCase("Write")) {
+		if ("Write".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_WRITE; // XA_PERM_TYPE_WRITE
 		}
-		if (label.equalsIgnoreCase("Create")) {
+		if ("Create".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_CREATE; // XA_PERM_TYPE_CREATE
 		}
-		if (label.equalsIgnoreCase("Delete")) {
+		if ("Delete".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_DELETE; // XA_PERM_TYPE_DELETE
 		}
-		if (label.equalsIgnoreCase("Admin")) {
+		if ("Admin".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_ADMIN; // XA_PERM_TYPE_ADMIN
 		}
-		if (label.equalsIgnoreCase("Obfuscate")) {
+		if ("Obfuscate".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_OBFUSCATE; // XA_PERM_TYPE_OBFUSCATE
 		}
-		if (label.equalsIgnoreCase("Mask")) {
+		if ("Mask".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_MASK; // XA_PERM_TYPE_MASK
 		}
-		if (label.equalsIgnoreCase("Execute")) {
+		if ("Execute".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_EXECUTE; // XA_PERM_TYPE_EXECUTE
 		}
-		if (label.equalsIgnoreCase("Select")) {
+		if ("Select".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_SELECT; // XA_PERM_TYPE_SELECT
 		}
-		if (label.equalsIgnoreCase("Update")) {
+		if ("Update".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_UPDATE; // XA_PERM_TYPE_UPDATE
 		}
-		if (label.equalsIgnoreCase("Drop")) {
+		if ("Drop".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_DROP; // XA_PERM_TYPE_DROP
 		}
-		if (label.equalsIgnoreCase("Alter")) {
+		if ("Alter".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_ALTER; // XA_PERM_TYPE_ALTER
 		}
-		if (label.equalsIgnoreCase("Index")) {
+		if ("Index".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_INDEX; // XA_PERM_TYPE_INDEX
 		}
-		if (label.equalsIgnoreCase("Lock")) {
+		if ("Lock".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_LOCK; // XA_PERM_TYPE_LOCK
 		}
-		if (label.equalsIgnoreCase("All")) {
+		if ("All".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_ALL; // XA_PERM_TYPE_ALL
 		}
-		if(label.equalsIgnoreCase("Allow")) {
+		if("Allow".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_ALLOW; //XA_PERM_TYPE_ALLOW
 		}
-		if(label.equalsIgnoreCase("submitTopology")) {
+		if("submitTopology".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_SUBMIT_TOPOLOGY; //XA_PERM_TYPE_SUBMIT_TOPOLOGY
 		}
-		if(label.equalsIgnoreCase("fileUpload")) {
+		if("fileUpload".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_FILE_UPLOAD; //XA_PERM_TYPE_FILE_UPLOAD
 		}
-		if(label.equalsIgnoreCase("getNimbusConf")) {
+		if("getNimbusConf".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_GET_NIMBUS; //XA_PERM_TYPE_GET_NIMBUS
 		}
-		if(label.equalsIgnoreCase("getClusterInfo")) {
+		if("getClusterInfo".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_GET_CLUSTER_INFO; //XA_PERM_TYPE_GET_CLUSTER_INFO
 		}
-		if(label.equalsIgnoreCase("fileDownload")) {
+		if("fileDownload".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_FILE_DOWNLOAD; //XA_PERM_TYPE_FILE_DOWNLOAD
 		}
-		if(label.equalsIgnoreCase("killTopology")) {
+		if("killTopology".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_KILL_TOPOLOGY; //XA_PERM_TYPE_KILL_TOPOLOGY
 		}
-		if(label.equalsIgnoreCase("rebalance")) {
+		if("rebalance".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_REBALANCE; //XA_PERM_TYPE_REBALANCE
 		}
-		if(label.equalsIgnoreCase("activate")) {
+		if("activate".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_ACTIVATE; //XA_PERM_TYPE_ACTIVATE
 		}
-		if(label.equalsIgnoreCase("deactivate")) {
+		if("deactivate".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_DEACTIVATE; //XA_PERM_TYPE_DEACTIVATE
 		}
-		if(label.equalsIgnoreCase("getTopologyConf")) {
+		if("getTopologyConf".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_GET_TOPOLOGY_CONF; //XA_PERM_TYPE_GET_TOPOLOGY_CONF
 		}
-		if(label.equalsIgnoreCase("getTopology")) {
+		if("getTopology".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_GET_TOPOLOGY; //XA_PERM_TYPE_GET_TOPOLOGY
 		}
-		if(label.equalsIgnoreCase("getUserTopology")) {
+		if("getUserTopology".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_GET_USER_TOPOLOGY; //XA_PERM_TYPE_GET_USER_TOPOLOGY
 		}
-		if(label.equalsIgnoreCase("getTopologyInfo")) {
+		if("getTopologyInfo".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_GET_TOPOLOGY_INFO; //XA_PERM_TYPE_GET_TOPOLOGY_INFO
 		}
-		if(label.equalsIgnoreCase("uploadNewCredentials")) {
+		if("uploadNewCredentials".equalsIgnoreCase(label)) {
 			return AppConstants.XA_PERM_TYPE_UPLOAD_NEW_CREDENTIAL; //XA_PERM_TYPE_UPLOAD_NEW_CREDENTIAL
 		}
 		return 0;
@@ -1161,10 +1161,10 @@ public class AppConstants extends RangerCommonEnums {
 		if (label == null) {
 			return 0;
 		}
-		if (label.equalsIgnoreCase("Inclusion")) {
+		if ("Inclusion".equalsIgnoreCase(label)) {
 			return AppConstants.POLICY_INCLUSION; // POLICY_INCLUSION
 		}
-		if (label.equalsIgnoreCase("Exclusion")) {
+		if ("Exclusion".equalsIgnoreCase(label)) {
 			return AppConstants.POLICY_EXCLUSION; // POLICY_EXCLUSION
 		}
 		return 0;

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/common/PropertiesUtil.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/common/PropertiesUtil.java b/security-admin/src/main/java/org/apache/ranger/common/PropertiesUtil.java
index 22d4b89..1392421 100644
--- a/security-admin/src/main/java/org/apache/ranger/common/PropertiesUtil.java
+++ b/security-admin/src/main/java/org/apache/ranger/common/PropertiesUtil.java
@@ -160,7 +160,7 @@ public class PropertiesUtil extends PropertyPlaceholderConfigurer {
 		if(path!=null && alias!=null){
 			String xaDBPassword=CredentialReader.getDecryptedString(path.trim(),alias.trim());
 			if(xaDBPassword!=null&& !xaDBPassword.trim().isEmpty() &&
-					!xaDBPassword.trim().equalsIgnoreCase("none")){
+					!"none".equalsIgnoreCase(xaDBPassword.trim())){
 				propertiesMap.put("ranger.jpa.jdbc.password", xaDBPassword);
 				props.put("ranger.jpa.jdbc.password", xaDBPassword);
 			}else{
@@ -174,7 +174,7 @@ public class PropertiesUtil extends PropertyPlaceholderConfigurer {
 		if(path!=null && alias!=null){
 			String auditDBPassword=CredentialReader.getDecryptedString(path.trim(), alias.trim());
 			if(auditDBPassword!=null&& !auditDBPassword.trim().isEmpty() &&
-					!auditDBPassword.trim().equalsIgnoreCase("none")){
+					!"none".equalsIgnoreCase(auditDBPassword.trim())){
 				propertiesMap.put("ranger.jpa.audit.jdbc.password", auditDBPassword);
 				props.put("ranger.jpa.audit.jdbc.password", auditDBPassword);
 			}else{
@@ -184,14 +184,14 @@ public class PropertiesUtil extends PropertyPlaceholderConfigurer {
 	}
 	if(propertiesMap!=null && propertiesMap.containsKey("ranger.authentication.method")){
 		String authenticationMethod=propertiesMap.get("ranger.authentication.method");
-		if(authenticationMethod!=null && (authenticationMethod.equalsIgnoreCase("ACTIVE_DIRECTORY")||authenticationMethod.equalsIgnoreCase("AD"))){
+		if(authenticationMethod!=null && ("ACTIVE_DIRECTORY".equalsIgnoreCase(authenticationMethod)||"AD".equalsIgnoreCase(authenticationMethod))){
 			if(propertiesMap!=null && propertiesMap.containsKey("ranger.credential.provider.path") && propertiesMap.containsKey("ranger.ldap.ad.binddn.credential.alias")){
 				String path=propertiesMap.get("ranger.credential.provider.path");
 				String alias=propertiesMap.get("ranger.ldap.ad.binddn.credential.alias");
 				if(path!=null && alias!=null){
 					String bindDNPassword=CredentialReader.getDecryptedString(path.trim(), alias.trim());
 					if(bindDNPassword!=null&& !bindDNPassword.trim().isEmpty() &&
-							!bindDNPassword.trim().equalsIgnoreCase("none")){
+							!"none".equalsIgnoreCase(bindDNPassword.trim())){
 						propertiesMap.put("ranger.ldap.ad.bind.password", bindDNPassword);
 						props.put("ranger.ldap.ad.bind.password", bindDNPassword);
 					}else{
@@ -203,14 +203,14 @@ public class PropertiesUtil extends PropertyPlaceholderConfigurer {
 	}
 	if(propertiesMap!=null && propertiesMap.containsKey("ranger.authentication.method")){
 		String authenticationMethod=propertiesMap.get("ranger.authentication.method");
-		if(authenticationMethod!=null && (authenticationMethod.equalsIgnoreCase("LDAP"))){
+		if(authenticationMethod!=null && ("LDAP".equalsIgnoreCase(authenticationMethod))){
 			if(propertiesMap!=null && propertiesMap.containsKey("ranger.credential.provider.path") && propertiesMap.containsKey("ranger.ldap.binddn.credential.alias")){
 				String path=propertiesMap.get("ranger.credential.provider.path");
 				String alias=propertiesMap.get("ranger.ldap.binddn.credential.alias");
 				if(path!=null && alias!=null){
 					String bindDNPassword=CredentialReader.getDecryptedString(path.trim(), alias.trim());
 					if(bindDNPassword!=null&& !bindDNPassword.trim().isEmpty() &&
-							!bindDNPassword.trim().equalsIgnoreCase("none")){
+							!"none".equalsIgnoreCase(bindDNPassword.trim())){
 						propertiesMap.put("ranger.ldap.bind.password", bindDNPassword);
 						props.put("ranger.ldap.bind.password", bindDNPassword);
 					}else{
@@ -222,14 +222,14 @@ public class PropertiesUtil extends PropertyPlaceholderConfigurer {
 	}
 	if(propertiesMap!=null && propertiesMap.containsKey("ranger.audit.source.type")){
 		String auditStore=propertiesMap.get("ranger.audit.source.type");
-		if(auditStore!=null && (auditStore.equalsIgnoreCase("solr"))){
+		if(auditStore!=null && ("solr".equalsIgnoreCase(auditStore))){
 			if(propertiesMap!=null && propertiesMap.containsKey("ranger.credential.provider.path") && propertiesMap.containsKey("ranger.solr.audit.credential.alias")){
 				String path=propertiesMap.get("ranger.credential.provider.path");
 				String alias=propertiesMap.get("ranger.solr.audit.credential.alias");
 				if(path!=null && alias!=null){
 					String solrAuditPassword=CredentialReader.getDecryptedString(path.trim(), alias.trim());
 					if(solrAuditPassword!=null&& !solrAuditPassword.trim().isEmpty() &&
-							!solrAuditPassword.trim().equalsIgnoreCase("none")){
+							!"none".equalsIgnoreCase(solrAuditPassword.trim())){
 						propertiesMap.put("ranger.solr.audit.user.password", solrAuditPassword);
 						props.put("ranger.solr.audit.user.password", solrAuditPassword);
 					}else{

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/common/RangerSearchUtil.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/common/RangerSearchUtil.java b/security-admin/src/main/java/org/apache/ranger/common/RangerSearchUtil.java
index c6be50e..92b0e03 100644
--- a/security-admin/src/main/java/org/apache/ranger/common/RangerSearchUtil.java
+++ b/security-admin/src/main/java/org/apache/ranger/common/RangerSearchUtil.java
@@ -296,13 +296,13 @@ public class RangerSearchUtil extends SearchUtil {
 				if (fieldValue != null) {
 					if (searchField.getCustomCondition() == null) {
 						whereClause.append(" and ").append(searchField.getFieldName());
-						if (searchField.getSearchType().equals(SearchField.SEARCH_TYPE.LESS_THAN)) {
+						if (SearchField.SEARCH_TYPE.LESS_THAN.equals(searchField.getSearchType())) {
 							whereClause.append("< :");
-						} else if (searchField.getSearchType().equals(SearchField.SEARCH_TYPE.LESS_EQUAL_THAN)) {
+						} else if (SearchField.SEARCH_TYPE.LESS_EQUAL_THAN.equals(searchField.getSearchType())) {
 							whereClause.append("<= :");
-						} else if (searchField.getSearchType().equals(SearchField.SEARCH_TYPE.GREATER_THAN)) {
+						} else if (SearchField.SEARCH_TYPE.GREATER_THAN.equals(searchField.getSearchType())) {
 							whereClause.append("> :");
-						} else if (searchField.getSearchType().equals(SearchField.SEARCH_TYPE.GREATER_EQUAL_THAN)) {
+						} else if (SearchField.SEARCH_TYPE.GREATER_EQUAL_THAN.equals(searchField.getSearchType())) {
 							whereClause.append(">= :");
 						}
 						whereClause.append(searchField.getClientFieldName());
@@ -408,7 +408,7 @@ public class RangerSearchUtil extends SearchUtil {
 			String sortType = searchCriteria.getSortType();
 			String querySortType = "asc";
 			if (sortType != null) {
-				if (sortType.equalsIgnoreCase("asc") || sortType.equalsIgnoreCase("desc")) {
+				if ("asc".equalsIgnoreCase(sortType) || "desc".equalsIgnoreCase(sortType)) {
 					querySortType = sortType;
 				} else {
 					logger.error("Invalid sortType. sortType=" + sortType);

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/common/SearchGroup.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/common/SearchGroup.java b/security-admin/src/main/java/org/apache/ranger/common/SearchGroup.java
index 00935f3..78df09e 100644
--- a/security-admin/src/main/java/org/apache/ranger/common/SearchGroup.java
+++ b/security-admin/src/main/java/org/apache/ranger/common/SearchGroup.java
@@ -55,7 +55,7 @@ public class SearchGroup {
 		for (SearchValue value : values) {
 			count++;
 			if (count > 0) {
-				if (condition.equals(CONDITION.AND)) {
+				if (CONDITION.AND.equals(condition)) {
 					whereClause.append(" AND ");
 				} else {
 					whereClause.append(" OR ");
@@ -89,7 +89,7 @@ public class SearchGroup {
 		for (SearchGroup searchGroup : searchGroups) {
 			count++;
 			if (count > 0) {
-				if (condition.equals(CONDITION.AND)) {
+				if (CONDITION.AND.equals(condition)) {
 					whereClause.append(" AND ");
 				} else {
 					whereClause.append(" OR ");

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/common/SearchUtil.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/common/SearchUtil.java b/security-admin/src/main/java/org/apache/ranger/common/SearchUtil.java
index 0723ee9..fe253ef 100644
--- a/security-admin/src/main/java/org/apache/ranger/common/SearchUtil.java
+++ b/security-admin/src/main/java/org/apache/ranger/common/SearchUtil.java
@@ -395,8 +395,8 @@ public class SearchUtil {
 			String sortType = searchCriteria.getSortType();
 			String querySortType = "asc";
 			if (sortType != null) {
-				if (sortType.equalsIgnoreCase("asc")
-						|| sortType.equalsIgnoreCase("desc")) {
+				if ("asc".equalsIgnoreCase(sortType)
+						|| "desc".equalsIgnoreCase(sortType)) {
 					querySortType = sortType;
 				} else {
 					logger.error("Invalid sortType. sortType=" + sortType);
@@ -589,17 +589,13 @@ public class SearchUtil {
 					if (searchField.getCustomCondition() == null) {
 						whereClause.append(" and ").append(
 								searchField.getFieldName());
-						if (searchField.getSearchType().equals(
-								SearchField.SEARCH_TYPE.LESS_THAN)) {
+						if (SearchField.SEARCH_TYPE.LESS_THAN.equals(searchField.getSearchType())) {
 							whereClause.append("< :");
-						} else if (searchField.getSearchType().equals(
-								SearchField.SEARCH_TYPE.LESS_EQUAL_THAN)) {
+						} else if (SearchField.SEARCH_TYPE.LESS_EQUAL_THAN.equals(searchField.getSearchType())) {
 							whereClause.append("<= :");
-						} else if (searchField.getSearchType().equals(
-								SearchField.SEARCH_TYPE.GREATER_THAN)) {
+						} else if (SearchField.SEARCH_TYPE.GREATER_THAN.equals(searchField.getSearchType())) {
 							whereClause.append("> :");
-						} else if (searchField.getSearchType().equals(
-								SearchField.SEARCH_TYPE.GREATER_EQUAL_THAN)) {
+						} else if (SearchField.SEARCH_TYPE.GREATER_EQUAL_THAN.equals(searchField.getSearchType())) {
 							whereClause.append(">= :");
 						}
 						whereClause.append(searchField.getClientFieldName());

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/common/ServiceUtil.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/common/ServiceUtil.java b/security-admin/src/main/java/org/apache/ranger/common/ServiceUtil.java
index 7f471b0..6ad56d2 100644
--- a/security-admin/src/main/java/org/apache/ranger/common/ServiceUtil.java
+++ b/security-admin/src/main/java/org/apache/ranger/common/ServiceUtil.java
@@ -352,24 +352,24 @@ public class ServiceUtil {
 			String                            resType   = e.getKey();
 			String                            resString = getResourceString(res.getValues());
 
-			if(resType.equalsIgnoreCase("path")) {
+			if("path".equalsIgnoreCase(resType)) {
 				ret.setName(resString);
 				ret.setIsRecursive(Boolean.TRUE.equals(res.getIsRecursive()) ? RangerCommonEnums.BOOL_TRUE : RangerCommonEnums.BOOL_FALSE);
-			} else if(resType.equalsIgnoreCase("table")) {
+			} else if("table".equalsIgnoreCase(resType)) {
 				ret.setTables(resString);
 				ret.setTableType(Boolean.TRUE.equals(res.getIsExcludes()) ? RangerCommonEnums.POLICY_EXCLUSION : RangerCommonEnums.POLICY_INCLUSION);
-			} else if(resType.equalsIgnoreCase("column-family")) {
+			} else if("column-family".equalsIgnoreCase(resType)) {
 				ret.setColumnFamilies(resString);
-			} else if(resType.equalsIgnoreCase("column")) {
+			} else if("column".equalsIgnoreCase(resType)) {
 				ret.setColumns(resString);
 				ret.setColumnType(Boolean.TRUE.equals(res.getIsExcludes()) ? RangerCommonEnums.POLICY_EXCLUSION : RangerCommonEnums.POLICY_INCLUSION);
-			} else if(resType.equalsIgnoreCase("database")) {
+			} else if("database".equalsIgnoreCase(resType)) {
 				ret.setDatabases(resString);
-			} else if(resType.equalsIgnoreCase("udf")) {
+			} else if("udf".equalsIgnoreCase(resType)) {
 				ret.setUdfs(resString);
-			} else if(resType.equalsIgnoreCase("topology")) {
+			} else if("topology".equalsIgnoreCase(resType)) {
 				ret.setTopologies(resString);
-			} else if(resType.equalsIgnoreCase("service")) {
+			} else if("service".equalsIgnoreCase(resType)) {
 				ret.setServices(resString);
 			}
 		}
@@ -814,24 +814,24 @@ public class ServiceUtil {
 			String                            resType   = e.getKey();
 			String                            resString = getResourceString(res.getValues());
 
-			if(resType.equalsIgnoreCase("path")) {
+			if("path".equalsIgnoreCase(resType)) {
 				ret.setResourceName(resString);
 				ret.setIsRecursive(Boolean.TRUE.equals(res.getIsRecursive()) ? true : false);
-			} else if(resType.equalsIgnoreCase("table")) {
+			} else if("table".equalsIgnoreCase(resType)) {
 				ret.setTables(resString);
 				ret.setTableType(Boolean.TRUE.equals(res.getIsExcludes()) ? toVxPolicyIncExc(RangerCommonEnums.POLICY_EXCLUSION):toVxPolicyIncExc(RangerCommonEnums.POLICY_INCLUSION));
-			} else if(resType.equalsIgnoreCase("column-family")) {
+			} else if("column-family".equalsIgnoreCase(resType)) {
 				ret.setColumnFamilies(resString);
-			} else if(resType.equalsIgnoreCase("column")) {
+			} else if("column".equalsIgnoreCase(resType)) {
 				ret.setColumns(resString);
 				ret.setColumnType(Boolean.TRUE.equals(res.getIsExcludes()) ? toVxPolicyIncExc(RangerCommonEnums.POLICY_EXCLUSION):toVxPolicyIncExc(RangerCommonEnums.POLICY_INCLUSION));
-			} else if(resType.equalsIgnoreCase("database")) {
+			} else if("database".equalsIgnoreCase(resType)) {
 				ret.setDatabases(resString);
-			} else if(resType.equalsIgnoreCase("udf")) {
+			} else if("udf".equalsIgnoreCase(resType)) {
 				ret.setUdfs(resString);
-			} else if(resType.equalsIgnoreCase("topology")) {
+			} else if("topology".equalsIgnoreCase(resType)) {
 				ret.setTopologies(resString);
-			} else if(resType.equalsIgnoreCase("service")) {
+			} else if("service".equalsIgnoreCase(resType)) {
 				ret.setServices(resString);
 			}
 		}
@@ -1087,7 +1087,7 @@ public class ServiceUtil {
 				if (vXPermObj.getPermList() != null) {
 					for (String perm : vXPermObj.getPermList()) {
 						if ( AppConstants.getEnumFor_XAPermType(perm) != 0 ) {
-							if (perm.equalsIgnoreCase("Admin")) {
+							if ("Admin".equalsIgnoreCase(perm)) {
 								delegatedAdmin=true;
 								if (assetType != RangerCommonEnums.ASSET_HBASE) {
 									continue;
@@ -1280,7 +1280,7 @@ public class ServiceUtil {
 					if(vXPermObj.getPermList() != null) {
 						for (String perm : vXPermObj.getPermList()) {
 							if ( AppConstants.getEnumFor_XAPermType(perm) != 0 ) {
-								if (perm.equalsIgnoreCase("Admin")) {
+								if ("Admin".equalsIgnoreCase(perm)) {
 									delegatedAdmin=true;
 									if (assetType!=null && assetType.intValue() != RangerCommonEnums.ASSET_HBASE) {
 										continue;
@@ -1412,7 +1412,7 @@ public class ServiceUtil {
 					try {
 						LdapName ln = new LdapName(dn);
 						for (Rdn rdn : ln.getRdns()) {
-							if (rdn.getType().equalsIgnoreCase("CN")) {
+							if ("CN".equalsIgnoreCase(rdn.getType())) {
 								commonName = rdn.getValue() + "";
 								break;
 							}

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/common/StringUtil.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/common/StringUtil.java b/security-admin/src/main/java/org/apache/ranger/common/StringUtil.java
index aab8669..045e07c 100644
--- a/security-admin/src/main/java/org/apache/ranger/common/StringUtil.java
+++ b/security-admin/src/main/java/org/apache/ranger/common/StringUtil.java
@@ -70,7 +70,7 @@ public class StringUtil implements Serializable {
 	}
 
 	public boolean isEmptyOrWildcardAsterisk(String str) {
-		return isEmpty(str) || str.equals(WILDCARD_ASTERISK);
+		return isEmpty(str) || WILDCARD_ASTERISK.equals(str);
 	}
 
 	public boolean equals(String str1, String str2) {

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManager.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManager.java b/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManager.java
index e3b878b..fddfda3 100644
--- a/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManager.java
+++ b/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManager.java
@@ -54,7 +54,7 @@ public class RangerDaoManager extends RangerDaoManagerBase {
 			logger.debug("RangerDaoManager.getEntityManager(" + persistenceContextUnit + ")");
 		}
 
-		if (persistenceContextUnit.equalsIgnoreCase("loggingPU")) {
+		if ("loggingPU".equalsIgnoreCase(persistenceContextUnit)) {
 			return loggingEM;
 		}
 		return getEntityManager();

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManagerBase.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManagerBase.java b/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManagerBase.java
index d718441..db20a14 100644
--- a/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManagerBase.java
+++ b/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManagerBase.java
@@ -203,167 +203,167 @@ public abstract class RangerDaoManagerBase {
 	}
 
 	public BaseDao<?> getDaoForClassName(String className) {
-		if (className.equals("XXDBBase")) {
+		if ("XXDBBase".equals(className)) {
 			return getXXDBBase();
 		}
-		if (className.equals("XXAuthSession")) {
+		if ("XXAuthSession".equals(className)) {
 			return getXXAuthSession();
 		}
-		if (className.equals("XXPortalUser")) {
+		if ("XXPortalUser".equals(className)) {
 			return getXXPortalUser();
 		}
-		if (className.equals("XXPortalUserRole")) {
+		if ("XXPortalUserRole".equals(className)) {
 			return getXXPortalUserRole();
 		}
-		if (className.equals("XXAsset")) {
+		if ("XXAsset".equals(className)) {
 			return getXXAsset();
 		}
-		if (className.equals("XXResource")) {
+		if ("XXResource".equals(className)) {
 			return getXXResource();
 		}
-		if (className.equals("XXCredentialStore")) {
+		if ("XXCredentialStore".equals(className)) {
 			return getXXCredentialStore();
 		}
-		if (className.equals("XXGroup")) {
+		if ("XXGroup".equals(className)) {
 			return getXXGroup();
 		}
-		if (className.equals("XXUser")) {
+		if ("XXUser".equals(className)) {
 			return getXXUser();
 		}
-		if (className.equals("XXGroupUser")) {
+		if ("XXGroupUser".equals(className)) {
 			return getXXGroupUser();
 		}
-		if (className.equals("XXGroupGroup")) {
+		if ("XXGroupGroup".equals(className)) {
 			return getXXGroupGroup();
 		}
-		if (className.equals("XXPermMap")) {
+		if ("XXPermMap".equals(className)) {
 			return getXXPermMap();
 		}
-		if (className.equals("XXAuditMap")) {
+		if ("XXAuditMap".equals(className)) {
 			return getXXAuditMap();
 		}
-		if (className.equals("XXPolicyExportAudit")) {
+		if ("XXPolicyExportAudit".equals(className)) {
 			return getXXPolicyExportAudit();
 		}
-		if (className.equals("XXTrxLog")) {
+		if ("XXTrxLog".equals(className)) {
 			return getXXTrxLog();
 		}
-		if (className.equals("XXAccessAudit")) {
+		if ("XXAccessAudit".equals(className)) {
 			return getXXAccessAudit();
 		}
-		if (className.equals("XXPolicy")) {
+		if ("XXPolicy".equals(className)) {
 			return getXXPolicy();
 		}
-		if (className.equals("XXService")) {
+		if ("XXService".equals(className)) {
 			return getXXService();
 		}
-		if (className.equals("XXPolicyItem")) {
+		if ("XXPolicyItem".equals(className)) {
 			return getXXPolicyItem();
 		}
-		if (className.equals("XXServiceDef")) {
+		if ("XXServiceDef".equals(className)) {
 			return getXXServiceDef();
 		}
-		if (className.equals("XXServiceConfigDef")) {
+		if ("XXServiceConfigDef".equals(className)) {
 			return getXXServiceConfigDef();
 		}
-		if (className.equals("XXResourceDef")) {
+		if ("XXResourceDef".equals(className)) {
 			return getXXResourceDef();
 		}
-		if (className.equals("XXAccessTypeDef")) {
+		if ("XXAccessTypeDef".equals(className)) {
 			return getXXAccessTypeDef();
 		}
-		if (className.equals("XXAccessTypeDefGrants")) {
+		if ("XXAccessTypeDefGrants".equals(className)) {
 			return getXXAccessTypeDefGrants();
 		}
-		if (className.equals("XXPolicyConditionDef")) {
+		if ("XXPolicyConditionDef".equals(className)) {
 			return getXXPolicyConditionDef();
 		}
-		if (className.equals("XXEnumDef")) {
+		if ("XXEnumDef".equals(className)) {
 			return getXXEnumDef();
 		}
-		if (className.equals("XXEnumElementDef")) {
+		if ("XXEnumElementDef".equals(className)) {
 			return getXXEnumElementDef();
 		}
-		if (className.equals("XXServiceConfigMap")) {
+		if ("XXServiceConfigMap".equals(className)) {
 			return getXXServiceConfigMap();
 		}
-		if (className.equals("XXPolicyResource")) {
+		if ("XXPolicyResource".equals(className)) {
 			return getXXPolicyResource();
 		}
-		if (className.equals("XXPolicyResourceMap")) {
+		if ("XXPolicyResourceMap".equals(className)) {
 			return getXXPolicyResourceMap();
 		}
-		if (className.equals("XXPolicyItemAccess")) {
+		if ("XXPolicyItemAccess".equals(className)) {
 			return getXXPolicyItemAccess();
 		}
-		if (className.equals("XXPolicyItemCondition")) {
+		if ("XXPolicyItemCondition".equals(className)) {
 			return getXXPolicyItemCondition();
 		}
-		if (className.equals("XXPolicyItemUserPerm")) {
+		if ("XXPolicyItemUserPerm".equals(className)) {
 			return getXXPolicyItemUserPerm();
 		}
-		if (className.equals("XXPolicyItemGroupPerm")) {
+		if ("XXPolicyItemGroupPerm".equals(className)) {
 			return getXXPolicyItemGroupPerm();
 		}
-		if (className.equals("XXDataHist")) {
+		if ("XXDataHist".equals(className)) {
 			return getXXDataHist();
 		}
-		if (className.equals("XXPolicyWithAssignedId")) {
+		if ("XXPolicyWithAssignedId".equals(className)) {
 			return getXXPolicyWithAssignedId();
 		}
-		if (className.equals("XXServiceWithAssignedId")) {
+		if ("XXServiceWithAssignedId".equals(className)) {
 			return getXXServiceWithAssignedId();
 		}
-		if (className.equals("XXModuleDef")) {
+		if ("XXModuleDef".equals(className)) {
 			return getXXModuleDef();
 		}
-		if (className.equals("XXUserPermission")) {
+		if ("XXUserPermission".equals(className)) {
 			return getXXUserPermission();
 		}
-		if (className.equals("XXGroupPermission")) {
+		if ("XXGroupPermission".equals(className)) {
 			return getXXGroupPermission();
 		}
-		if (className.equals("XXServiceDefWithAssignedId")) {
+		if ("XXServiceDefWithAssignedId".equals(className)) {
 			return getXXServiceDefWithAssignedId();
 		}
 
-		if (className.equals("XXTagDef")) {
+		if ("XXTagDef".equals(className)) {
 			return getXXTagDef();
 		}
-		if (className.equals("XXTagAttributeDef")) {
+		if ("XXTagAttributeDef".equals(className)) {
 			return getXXTagAttributeDef();
 		}
-		if (className.equals("XXServiceResource")) {
+		if ("XXServiceResource".equals(className)) {
 			return getXXServiceResource();
 		}
-		if (className.equals("XXServiceResourceElement")) {
+		if ("XXServiceResourceElement".equals(className)) {
 			return getXXServiceResourceElement();
 		}
-		if (className.equals("XXServiceResourceElementValue")) {
+		if ("XXServiceResourceElementValue".equals(className)) {
 			return getXXServiceResourceElementValue();
 		}
-		if (className.equals("XXTag")) {
+		if ("XXTag".equals(className)) {
 			return getXXTag();
 		}
-		if (className.equals("XXTagAttribute")) {
+		if ("XXTagAttribute".equals(className)) {
 			return getXXTagAttribute();
 		}
-		if (className.equals("XXTagResourceMap")) {
+		if ("XXTagResourceMap".equals(className)) {
 			return getXXTagResourceMap();
 		}
-		if (className.equals("XXDataMaskTypeDef")) {
+		if ("XXDataMaskTypeDef".equals(className)) {
 			return getXXDataMaskTypeDef();
 		}
-		if (className.equals("XXPolicyItemDataMaskInfo")) {
+		if ("XXPolicyItemDataMaskInfo".equals(className)) {
 			return getXXPolicyItemDataMaskInfo();
 		}
-		if (className.equals("XXPolicyItemRowFilterInfo")) {
+		if ("XXPolicyItemRowFilterInfo".equals(className)) {
 			return getXXPolicyItemRowFilterInfo();
 		}
-		if (className.equals("XXServiceVersionInfo")) {
+		if ("XXServiceVersionInfo".equals(className)) {
 			return getXXServiceVersionInfo();
 		}
-		if (className.equals("XXPluginInfo")) {
+		if ("XXPluginInfo".equals(className)) {
 			return getXXPluginInfo();
 		}
 		logger.error("No DaoManager found for className=" + className, new Throwable());

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAuditBase.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAuditBase.java b/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAuditBase.java
index 8efcfc3..76da309 100644
--- a/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAuditBase.java
+++ b/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAuditBase.java
@@ -647,10 +647,10 @@ public class XXAccessAuditBase extends XXDBBase implements java.io.Serializable
 		return true;
 	}
 	public static String getEnumName(String fieldName ) {
-		if( fieldName.equals("auditType") ) {
+		if( "auditType".equals(fieldName) ) {
 			return "CommonEnums.AssetType";
 		}
-		if( fieldName.equals("accessResult") ) {
+		if( "accessResult".equals(fieldName) ) {
 			return "CommonEnums.AccessResult";
 		}
 		return null;

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/entity/XXAsset.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXAsset.java b/security-admin/src/main/java/org/apache/ranger/entity/XXAsset.java
index 158c966..ac42ceb 100644
--- a/security-admin/src/main/java/org/apache/ranger/entity/XXAsset.java
+++ b/security-admin/src/main/java/org/apache/ranger/entity/XXAsset.java
@@ -279,10 +279,10 @@ public class XXAsset extends XXDBBase implements java.io.Serializable {
 		return true;
 	}
 	public static String getEnumName(String fieldName ) {
-		if( fieldName.equals("activeStatus") ) {
+		if( "activeStatus".equals(fieldName) ) {
 			return "CommonEnums.ActiveStatus";
 		}
-		if( fieldName.equals("assetType") ) {
+		if( "assetType".equals(fieldName) ) {
 			return "CommonEnums.AssetType";
 		}
 		//Later TODO

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/entity/XXAuditMap.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXAuditMap.java b/security-admin/src/main/java/org/apache/ranger/entity/XXAuditMap.java
index 95c2bf6..5f51278 100644
--- a/security-admin/src/main/java/org/apache/ranger/entity/XXAuditMap.java
+++ b/security-admin/src/main/java/org/apache/ranger/entity/XXAuditMap.java
@@ -220,7 +220,7 @@ public class XXAuditMap extends XXDBBase implements java.io.Serializable {
 		return true;
 	}
 	public static String getEnumName(String fieldName ) {
-		if( fieldName.equals("auditType") ) {
+		if( "auditType".equals(fieldName) ) {
 			return "CommonEnums.XAAuditType";
 		}
 		//Later TODO

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/entity/XXAuthSession.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXAuthSession.java b/security-admin/src/main/java/org/apache/ranger/entity/XXAuthSession.java
index deedc87..c277158 100644
--- a/security-admin/src/main/java/org/apache/ranger/entity/XXAuthSession.java
+++ b/security-admin/src/main/java/org/apache/ranger/entity/XXAuthSession.java
@@ -460,16 +460,16 @@ public class XXAuthSession extends XXDBBase implements java.io.Serializable {
 		return true;
 	}
 	public static String getEnumName(String fieldName ) {
-		if( fieldName.equals("authStatus") ) {
+		if( "authStatus".equals(fieldName) ) {
 			return "CommonEnums.AuthStatus";
 		}
-		if( fieldName.equals("authType") ) {
+		if( "authType".equals(fieldName) ) {
 			return "CommonEnums.AuthType";
 		}
-		if( fieldName.equals("authProvider") ) {
+		if( "authProvider".equals(fieldName) ) {
 			return "CommonEnums.AuthType";
 		}
-		if( fieldName.equals("deviceType") ) {
+		if( "deviceType".equals(fieldName) ) {
 			return "CommonEnums.DeviceType";
 		}
 		//Later TODO

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/entity/XXGroup.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXGroup.java b/security-admin/src/main/java/org/apache/ranger/entity/XXGroup.java
index 04aedbd..dc95b58 100644
--- a/security-admin/src/main/java/org/apache/ranger/entity/XXGroup.java
+++ b/security-admin/src/main/java/org/apache/ranger/entity/XXGroup.java
@@ -292,10 +292,10 @@ public class XXGroup extends XXDBBase implements java.io.Serializable {
 		return true;
 	}
 	public static String getEnumName(String fieldName ) {
-		if( fieldName.equals("status") ) {
+		if( "status".equals(fieldName) ) {
 			return "CommonEnums.ActiveStatus";
 		}
-		if( fieldName.equals("groupType") ) {
+		if( "groupType".equals(fieldName) ) {
 			return "CommonEnums.XAGroupType";
 		}
 		//Later TODO

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/entity/XXPermMap.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPermMap.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPermMap.java
index 7c6b96c..b53d153 100644
--- a/security-admin/src/main/java/org/apache/ranger/entity/XXPermMap.java
+++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPermMap.java
@@ -385,13 +385,13 @@ public class XXPermMap extends XXDBBase implements java.io.Serializable {
 		return true;
 	}
 	public static String getEnumName(String fieldName ) {
-		if( fieldName.equals("permFor") ) {
+		if( "permFor".equals(fieldName) ) {
 			return "CommonEnums.XAPermForType";
 		}
-		if( fieldName.equals("permType") ) {
+		if( "permType".equals(fieldName) ) {
 			return "CommonEnums.XAPermType";
 		}
-		if( fieldName.equals("isRecursive") ) {
+		if( "isRecursive".equals(fieldName) ) {
 			return "CommonEnums.BooleanValue";
 		}
 		//Later TODO

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUser.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUser.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUser.java
index f7df09e..89b180d 100644
--- a/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUser.java
+++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUser.java
@@ -369,10 +369,10 @@ public class XXPortalUser extends XXDBBase implements java.io.Serializable {
 		return true;
 	}
 	public static String getEnumName(String fieldName ) {
-		if( fieldName.equals("status") ) {
+		if( "status".equals(fieldName) ) {
 			return "CommonEnums.ActivationStatus";
 		}
-		if( fieldName.equals("userSource") ) {
+		if( "userSource".equals(fieldName) ) {
 			return "CommonEnums.UserSource";
 		}
 		//Later TODO

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUserRole.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUserRole.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUserRole.java
index 97f52c4..2f5e400 100644
--- a/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUserRole.java
+++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUserRole.java
@@ -180,7 +180,7 @@ public class XXPortalUserRole extends XXDBBase implements java.io.Serializable {
 		return true;
 	}
 	public static String getEnumName(String fieldName ) {
-		if( fieldName.equals("status") ) {
+		if( "status".equals(fieldName) ) {
 			return "CommonEnums.ActiveStatus";
 		}
 		//Later TODO

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/entity/XXResource.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXResource.java b/security-admin/src/main/java/org/apache/ranger/entity/XXResource.java
index e571a4f..a47a530 100644
--- a/security-admin/src/main/java/org/apache/ranger/entity/XXResource.java
+++ b/security-admin/src/main/java/org/apache/ranger/entity/XXResource.java
@@ -694,25 +694,25 @@ public class XXResource extends XXDBBase implements java.io.Serializable {
 		return true;
 	}
 	public static String getEnumName(String fieldName ) {
-		if( fieldName.equals("resourceType") ) {
+		if( "resourceType".equals(fieldName) ) {
 			return "CommonEnums.ResourceType";
 		}
-		if( fieldName.equals("isEncrypt") ) {
+		if( "isEncrypt".equals(fieldName) ) {
 			return "CommonEnums.BooleanValue";
 		}
-		if( fieldName.equals("isRecursive") ) {
+		if( "isRecursive".equals(fieldName) ) {
 			return "CommonEnums.BooleanValue";
 		}
-		if( fieldName.equals("resourceStatus") ) {
+		if( "resourceStatus".equals(fieldName) ) {
 			return "CommonEnums.ActiveStatus";
 		}
-		if( fieldName.equals("tableType") ) {
+		if( "tableType".equals(fieldName) ) {
 			return "CommonEnums.PolicyType";
 		}
-		if( fieldName.equals("columnType") ) {
+		if( "columnType".equals(fieldName) ) {
 			return "CommonEnums.PolicyType";
 		}
-		if( fieldName.equals("assetType") ) {
+		if( "assetType".equals(fieldName) ) {
 			return "CommonEnums.AssetType";
 		}
 		//Later TODO

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/entity/XXTrxLog.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXTrxLog.java b/security-admin/src/main/java/org/apache/ranger/entity/XXTrxLog.java
index ceea47b..4ef5262 100644
--- a/security-admin/src/main/java/org/apache/ranger/entity/XXTrxLog.java
+++ b/security-admin/src/main/java/org/apache/ranger/entity/XXTrxLog.java
@@ -516,7 +516,7 @@ public class XXTrxLog extends XXDBBase implements java.io.Serializable {
 		return true;
 	}
 	public static String getEnumName(String fieldName ) {
-		if( fieldName.equals("objectClassType") ) {
+		if( "objectClassType".equals(fieldName) ) {
 			return "CommonEnums.ClassTypes";
 		}
 		//Later TODO

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/entity/XXUser.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXUser.java b/security-admin/src/main/java/org/apache/ranger/entity/XXUser.java
index 512c567..4720095 100644
--- a/security-admin/src/main/java/org/apache/ranger/entity/XXUser.java
+++ b/security-admin/src/main/java/org/apache/ranger/entity/XXUser.java
@@ -251,7 +251,7 @@ public class XXUser extends XXDBBase implements java.io.Serializable {
 		return true;
 	}
 	public static String getEnumName(String fieldName ) {
-		if( fieldName.equals("status") ) {
+		if( "status".equals(fieldName) ) {
 			return "CommonEnums.ActiveStatus";
 		}
 		//Later TODO

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/patch/cliutil/DbToSolrMigrationUtil.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/patch/cliutil/DbToSolrMigrationUtil.java b/security-admin/src/main/java/org/apache/ranger/patch/cliutil/DbToSolrMigrationUtil.java
index 1ddd367..89d5f4d 100644
--- a/security-admin/src/main/java/org/apache/ranger/patch/cliutil/DbToSolrMigrationUtil.java
+++ b/security-admin/src/main/java/org/apache/ranger/patch/cliutil/DbToSolrMigrationUtil.java
@@ -390,13 +390,13 @@ public class DbToSolrMigrationUtil extends BaseLoader {
 					.getProperty("ranger.solr.url");
 		}
 
-		if (zkHosts != null && !zkHosts.trim().equals("")
-				&& !zkHosts.trim().equalsIgnoreCase("none")) {
+		if (zkHosts != null && !"".equals(zkHosts.trim())
+				&& !"none".equalsIgnoreCase(zkHosts.trim())) {
 			zkHosts = zkHosts.trim();
 			String collectionName = PropertiesUtil
 					.getProperty(SOLR_COLLECTION_NAME);
 			if (collectionName == null
-					|| collectionName.equalsIgnoreCase("none")) {
+					|| "none".equalsIgnoreCase(collectionName)) {
 				collectionName = DEFAULT_COLLECTION_NAME;
 			}
 
@@ -420,7 +420,7 @@ public class DbToSolrMigrationUtil extends BaseLoader {
 			}
 		} else {
 			if (solrURL == null || solrURL.isEmpty()
-					|| solrURL.equalsIgnoreCase("none")) {
+					|| "none".equalsIgnoreCase(solrURL)) {
 				logger.fatal("Solr ZKHosts and URL for Audit are empty. Please set property "
 						+ SOLR_ZK_HOSTS
 						+ " or "

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/patch/cliutil/MetricUtil.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/patch/cliutil/MetricUtil.java b/security-admin/src/main/java/org/apache/ranger/patch/cliutil/MetricUtil.java
index 3fe34be..d1ab0d0 100644
--- a/security-admin/src/main/java/org/apache/ranger/patch/cliutil/MetricUtil.java
+++ b/security-admin/src/main/java/org/apache/ranger/patch/cliutil/MetricUtil.java
@@ -93,7 +93,7 @@ public class MetricUtil extends BaseLoader  {
 			if (args.length != 2) {
 				System.out.println("type: Incorrect Arguments usage : -type policies | audits | usergroup | services | database | contextenrichers | denyconditions");
 			} else {
-				if (!(args[0].equalsIgnoreCase("-type")) || !(args[1].equalsIgnoreCase("policies") || args[1].equalsIgnoreCase("audits") || args[1].equalsIgnoreCase("usergroup") || args[1].equalsIgnoreCase("services") || args[1].equalsIgnoreCase("database") || args[1].equalsIgnoreCase("contextenrichers") || args[1].equalsIgnoreCase("denyconditions"))) {
+				if (!("-type".equalsIgnoreCase(args[0])) || !("policies".equalsIgnoreCase(args[1]) || "audits".equalsIgnoreCase(args[1]) || "usergroup".equalsIgnoreCase(args[1]) || "services".equalsIgnoreCase(args[1]) || "database".equalsIgnoreCase(args[1]) || "contextenrichers".equalsIgnoreCase(args[1]) || "denyconditions".equalsIgnoreCase(args[1]))) {
 					System.out.println("type: Incorrect Arguments usage : -type policies | audits | usergroup | services | database | contextenrichers | denyconditions");
 				} else {
 					metricType = args[1];
@@ -447,7 +447,7 @@ public class MetricUtil extends BaseLoader  {
 				PList<RangerPolicy> policiestype = svcStore.getPaginatedPolicies(policyFilter1);
 				long count = policiestype.getTotalCount();
 				if (count != 0) {
-					if (!serviceName.equalsIgnoreCase("tag")) {
+					if (!"tag".equalsIgnoreCase(serviceName)) {
 						servicesforPolicyType.put(serviceName, count);
 					} else {
 						tagCount = count;

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java b/security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
index 6176319..b9f1832 100644
--- a/security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
+++ b/security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
@@ -308,7 +308,7 @@ public class ServiceREST {
 
 			String forceDeleteStr = request.getParameter("forceDelete");
 			boolean forceDelete = false;
-			if(!StringUtils.isEmpty(forceDeleteStr) && forceDeleteStr.equalsIgnoreCase("true")) {
+			if(!StringUtils.isEmpty(forceDeleteStr) && "true".equalsIgnoreCase(forceDeleteStr)) {
 				forceDelete = true;
 			}
 			
@@ -502,11 +502,11 @@ public class ServiceREST {
 				bizUtil.hasKMSPermissions("Service", xxServiceDef.getImplclassname());
 			}
 			if(session != null && session.isSpnegoEnabled()){
-				if (session.isKeyAdmin() && !xxServiceDef.getImplclassname().equals(EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME)) {
+				if (session.isKeyAdmin() && !EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME.equals(xxServiceDef.getImplclassname())) {
 					throw restErrorUtil.createRESTException("KeyAdmin can create/update/delete only KMS ",
 							MessageEnums.OPER_NO_PERMISSION);
 				}
-				if ((!session.isKeyAdmin() && !session.isUserAdmin()) && xxServiceDef.getImplclassname().equals(EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME)) {
+				if ((!session.isKeyAdmin() && !session.isUserAdmin()) && EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME.equals(xxServiceDef.getImplclassname())) {
 					throw restErrorUtil.createRESTException("User cannot create/update/delete KMS Service",
 							MessageEnums.OPER_NO_PERMISSION);
 				}
@@ -2790,13 +2790,13 @@ public class ServiceREST {
 			XXServiceDef xServiceDef = daoManager.getXXServiceDef().getById(xService.getType());
 
 			if (isAdmin) {
-				if (xServiceDef.getImplclassname().equals(EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME)) {
+				if (EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME.equals(xServiceDef.getImplclassname())) {
 					throw restErrorUtil.createRESTException(
 							"KMS Policies/Services/Service-Defs are not accessible for user '" + userName + "'.",
 							MessageEnums.OPER_NO_PERMISSION);
 				}
 			} else if (isKeyAdmin) {
-				if (!xServiceDef.getImplclassname().equals(EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME)) {
+				if (!EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME.equals(xServiceDef.getImplclassname())) {
 					throw restErrorUtil.createRESTException(
 							"Only KMS Policies/Services/Service-Defs are accessible for user '" + userName + "'.",
 							MessageEnums.OPER_NO_PERMISSION);

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/security/handler/RangerAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/security/handler/RangerAuthenticationProvider.java b/security-admin/src/main/java/org/apache/ranger/security/handler/RangerAuthenticationProvider.java
index 3fdd5c2..5a4d639 100644
--- a/security-admin/src/main/java/org/apache/ranger/security/handler/RangerAuthenticationProvider.java
+++ b/security-admin/src/main/java/org/apache/ranger/security/handler/RangerAuthenticationProvider.java
@@ -99,7 +99,7 @@ public class RangerAuthenticationProvider implements AuthenticationProvider {
 			rangerAuthenticationMethod="NONE";
 		}
 		if (authentication != null && rangerAuthenticationMethod != null) {
-			if (rangerAuthenticationMethod.equalsIgnoreCase("LDAP")) {
+			if ("LDAP".equalsIgnoreCase(rangerAuthenticationMethod)) {
 				authentication = getLdapAuthentication(authentication);
 				if (authentication!=null && authentication.isAuthenticated()) {
 					return authentication;
@@ -110,7 +110,7 @@ public class RangerAuthenticationProvider implements AuthenticationProvider {
 					}
 				}
 			}
-			if (rangerAuthenticationMethod.equalsIgnoreCase("ACTIVE_DIRECTORY")) {
+			if ("ACTIVE_DIRECTORY".equalsIgnoreCase(rangerAuthenticationMethod)) {
 				authentication = getADBindAuthentication(authentication);
 				if (authentication != null && authentication.isAuthenticated()) {
 					return authentication;
@@ -121,14 +121,14 @@ public class RangerAuthenticationProvider implements AuthenticationProvider {
 					}
 				}
 			}
-			if (rangerAuthenticationMethod.equalsIgnoreCase("UNIX")) {
+			if ("UNIX".equalsIgnoreCase(rangerAuthenticationMethod)) {
                 boolean isPAMAuthEnabled = PropertiesUtil.getBooleanProperty("ranger.pam.authentication.enabled", false);
                 authentication= (isPAMAuthEnabled ? getPamAuthentication(authentication) : getUnixAuthentication(authentication));
 				if (authentication != null && authentication.isAuthenticated()) {
 					return authentication;
 				}
 			}
-			if (rangerAuthenticationMethod.equalsIgnoreCase("PAM")) {
+			if ("PAM".equalsIgnoreCase(rangerAuthenticationMethod)) {
 				authentication = getPamAuthentication(authentication);
 				if (authentication != null && authentication.isAuthenticated()) {
 					return authentication;

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthFailureHandler.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthFailureHandler.java b/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthFailureHandler.java
index 8d9363a..580b6bc 100644
--- a/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthFailureHandler.java
+++ b/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthFailureHandler.java
@@ -82,7 +82,7 @@ ExceptionMappingAuthenticationFailureHandler {
 			String msg = exception.getMessage();
 			VXResponse vXResponse = new VXResponse();
 			if(msg!=null && !msg.isEmpty()){
-				if(msg.equalsIgnoreCase("Bad credentials")){
+				if("Bad credentials".equalsIgnoreCase(msg)){
 					vXResponse.setStatusCode(HttpServletResponse.SC_UNAUTHORIZED);
 					vXResponse.setMsgDesc("The username or password you entered is incorrect..");
 				}else if(msg.contains("Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!")){
@@ -91,7 +91,7 @@ ExceptionMappingAuthenticationFailureHandler {
 				}else if(msg.contains("Communications link failure")){
 					vXResponse.setStatusCode(HttpServletResponse.SC_UNAUTHORIZED);
 					vXResponse.setMsgDesc("Unable to connect to DB..");
-				}else if(msg.equalsIgnoreCase("User is disabled")){
+				}else if("User is disabled".equalsIgnoreCase(msg)){
 					vXResponse.setStatusCode(HttpServletResponse.SC_UNAUTHORIZED);
 					vXResponse.setMsgDesc("The username or password you entered is disable..");
 				}
@@ -103,7 +103,7 @@ ExceptionMappingAuthenticationFailureHandler {
 			logger.info("Error while writing JSON in HttpServletResponse");
 		}
 	
-	if (ajaxRequestHeader != null && ajaxRequestHeader.equalsIgnoreCase("XMLHttpRequest")) {
+	if (ajaxRequestHeader != null && "XMLHttpRequest".equalsIgnoreCase(ajaxRequestHeader)) {
 //	    if (logger.isDebugEnabled()) {
 //		logger.debug("Forwarding AJAX login request failure to "
 //			+ ajaxLoginfailurePage);

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthSuccessHandler.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthSuccessHandler.java b/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthSuccessHandler.java
index 948d328..66e45c7 100644
--- a/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthSuccessHandler.java
+++ b/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthSuccessHandler.java
@@ -123,7 +123,7 @@ SavedRequestAwareAuthenticationSuccessHandler {
 			if (logger.isDebugEnabled()) {
 			    logger.debug("commence() X-Requested-With=" + ajaxRequestHeader);
 			}
-			if (ajaxRequestHeader != null && ajaxRequestHeader.equalsIgnoreCase("XMLHttpRequest")) {
+			if (ajaxRequestHeader != null && "XMLHttpRequest".equalsIgnoreCase(ajaxRequestHeader)) {
 				// if (logger.isDebugEnabled()) {
 				// logger.debug("Forwarding AJAX login request success to "
 				// + ajaxLoginSuccessPage + " for user "

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthenticationEntryPoint.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthenticationEntryPoint.java b/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthenticationEntryPoint.java
index e7e5f5d..d9c2bcf 100644
--- a/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthenticationEntryPoint.java
+++ b/security-admin/src/main/java/org/apache/ranger/security/web/authentication/RangerAuthenticationEntryPoint.java
@@ -121,7 +121,7 @@ public class RangerAuthenticationEntryPoint extends
 		}
 
 		if (ajaxRequestHeader != null
-				&& ajaxRequestHeader.equalsIgnoreCase("XMLHttpRequest")) {
+				&& "XMLHttpRequest".equalsIgnoreCase(ajaxRequestHeader)) {
 			if (logger.isDebugEnabled()) {
 				logger.debug("commence() AJAX request. Authentication required. Returning "
 						+ ajaxReturnCode + ". URL=" + request.getRequestURI());

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerKRBAuthenticationFilter.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerKRBAuthenticationFilter.java b/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerKRBAuthenticationFilter.java
index c8d22aa..ec6d78d 100644
--- a/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerKRBAuthenticationFilter.java
+++ b/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerKRBAuthenticationFilter.java
@@ -195,7 +195,7 @@ public class RangerKRBAuthenticationFilter extends RangerKrbFilter {
 		}
 		String sessionUserName = request.getParameter(S_USER);
 		String pathInfo = request.getPathInfo();
-		if(!StringUtils.isEmpty(sessionUserName) && sessionUserName.equalsIgnoreCase("keyadmin") && !StringUtils.isEmpty(pathInfo) && pathInfo.contains("public/v2/api/service")){
+		if(!StringUtils.isEmpty(sessionUserName) && "keyadmin".equalsIgnoreCase(sessionUserName) && !StringUtils.isEmpty(pathInfo) && pathInfo.contains("public/v2/api/service")){
 			LOG.info("Session will be created by : "+sessionUserName);
 			userName = sessionUserName;
 		}
@@ -244,7 +244,7 @@ public class RangerKRBAuthenticationFilter extends RangerKrbFilter {
 			if(cookie != null){
 				for(Cookie c : cookie){
 					String cname = c.getName();
-					if(cname != null && cname.equalsIgnoreCase("u"))
+					if(cname != null && "u".equalsIgnoreCase(cname))
 					{
 						int ustr = cname.indexOf("u=");
 						if(ustr != -1){
@@ -253,7 +253,7 @@ public class RangerKRBAuthenticationFilter extends RangerKrbFilter {
 								userName = cname.substring(ustr+2, andStr);
 							}
 						}
-					}else if(cname != null && cname.equalsIgnoreCase(AUTH_COOKIE_NAME)){
+					}else if(cname != null && AUTH_COOKIE_NAME.equalsIgnoreCase(cname)){
 						int ustr = cname.indexOf("u=");
 						if(ustr != -1){
 							int andStr = cname.indexOf("&", ustr);
@@ -295,7 +295,7 @@ public class RangerKRBAuthenticationFilter extends RangerKrbFilter {
 	private boolean isSpnegoEnable(String authType){
 		String principal = PropertiesUtil.getProperty(PRINCIPAL);
 		String keytabPath = PropertiesUtil.getProperty(KEYTAB);
-		return ((!StringUtils.isEmpty(authType)) && authType.equalsIgnoreCase(KERBEROS_TYPE) && SecureClientLogin.isKerberosCredentialExists(principal, keytabPath));
+		return ((!StringUtils.isEmpty(authType)) && KERBEROS_TYPE.equalsIgnoreCase(authType) && SecureClientLogin.isKerberosCredentialExists(principal, keytabPath));
 	}
 	
 	private Authentication getGrantedAuthority(Authentication authentication) {

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerKrbFilter.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerKrbFilter.java b/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerKrbFilter.java
index dbf6248..ca0d17e 100644
--- a/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerKrbFilter.java
+++ b/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerKrbFilter.java
@@ -518,7 +518,7 @@ public class RangerKrbFilter implements Filter {
 	            Collection<String> headerNames = httpResponse.getHeaderNames();
 	            for(String headerName : headerNames){
 	                String value = httpResponse.getHeader(headerName);
-	                if(headerName.equalsIgnoreCase("Set-Cookie") && value.startsWith("RANGERADMINSESSIONID")){
+	                if("Set-Cookie".equalsIgnoreCase(headerName) && value.startsWith("RANGERADMINSESSIONID")){
 	                    chk = false;
 	                    break;
 	                }

http://git-wip-us.apache.org/repos/asf/ranger/blob/1d18e76d/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerSSOAuthenticationFilter.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerSSOAuthenticationFilter.java b/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerSSOAuthenticationFilter.java
index 7d8fdb2..ffb60b9 100644
--- a/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerSSOAuthenticationFilter.java
+++ b/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerSSOAuthenticationFilter.java
@@ -117,7 +117,7 @@ public class RangerSSOAuthenticationFilter implements Filter {
 		HttpServletRequest httpRequest = (HttpServletRequest)servletRequest;
 		if (httpRequest.getRequestedSessionId() != null && !httpRequest.isRequestedSessionIdValid()){
 			synchronized(httpRequest.getServletContext()){
-				if(httpRequest.getServletContext().getAttribute(httpRequest.getRequestedSessionId()) != null && httpRequest.getServletContext().getAttribute(httpRequest.getRequestedSessionId()).toString().equals("locallogin")){
+				if(httpRequest.getServletContext().getAttribute(httpRequest.getRequestedSessionId()) != null && "locallogin".equals(httpRequest.getServletContext().getAttribute(httpRequest.getRequestedSessionId()).toString())){
 					ssoEnabled = false;
 					httpRequest.getSession().setAttribute("locallogin","true");
 					httpRequest.getServletContext().removeAttribute(httpRequest.getRequestedSessionId());


Mime
View raw message