knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmin...@apache.org
Subject knox git commit: KNOX-496: Remove redundant and unnecessary null check from KnoxLdapRealm and DeploymentFactory Contributed by andreina
Date Wed, 11 Feb 2015 16:43:11 GMT
Repository: knox
Updated Branches:
  refs/heads/master 1275b0882 -> ba4c2010a


KNOX-496: Remove redundant and unnecessary null check from KnoxLdapRealm and DeploymentFactory
Contributed by andreina


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

Branch: refs/heads/master
Commit: ba4c2010a5fa1785fc014362900744aa727a1489
Parents: 1275b08
Author: Kevin Minder <kevin.minder@hortonworks.com>
Authored: Wed Feb 11 11:42:47 2015 -0500
Committer: Kevin Minder <kevin.minder@hortonworks.com>
Committed: Wed Feb 11 11:42:47 2015 -0500

----------------------------------------------------------------------
 .../org/apache/hadoop/gateway/shirorealm/KnoxLdapRealm.java  | 2 --
 .../org/apache/hadoop/gateway/deploy/DeploymentFactory.java  | 8 ++------
 2 files changed, 2 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/ba4c2010/gateway-provider-security-shiro/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapRealm.java
----------------------------------------------------------------------
diff --git a/gateway-provider-security-shiro/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapRealm.java
b/gateway-provider-security-shiro/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapRealm.java
index 1cf9fd8..00c0d68 100644
--- a/gateway-provider-security-shiro/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapRealm.java
+++ b/gateway-provider-security-shiro/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapRealm.java
@@ -476,7 +476,6 @@ public class KnoxLdapRealm extends JndiLdapRealm {
       }
     }
     finally {
-      if (searchResultEnum != null) {
         try {
           if (searchResultEnum != null) {
             searchResultEnum.close();
@@ -485,7 +484,6 @@ public class KnoxLdapRealm extends JndiLdapRealm {
         finally {
           LdapUtils.closeContext(systemLdapCtx);
         }
-      }
     }
     return member;
   }

http://git-wip-us.apache.org/repos/asf/knox/blob/ba4c2010/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/DeploymentFactory.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/DeploymentFactory.java
b/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/DeploymentFactory.java
index d1069f4..44ba37a 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/DeploymentFactory.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/DeploymentFactory.java
@@ -219,9 +219,7 @@ public abstract class DeploymentFactory {
     for( String role : providers.keySet() ) {
       for( ProviderDeploymentContributor contributor : providers.get( role ) ) {
         try {
-          if (gatewayServices != null) {
-            injectServices(contributor);
-          }
+          injectServices(contributor);
           contributor.initializeContribution( context );
         } catch( Exception e ) {
           log.failedToInitializeContribution( e );
@@ -232,9 +230,7 @@ public abstract class DeploymentFactory {
     for( String role : services.keySet() ) {
       for( ServiceDeploymentContributor contributor : services.get( role ) ) {
         try {
-          if (services != null) {
-            injectServices(contributor);
-          }
+          injectServices(contributor);
           contributor.initializeContribution( context );
         } catch( Exception e ) {
           log.failedToInitializeContribution( e );


Mime
View raw message