You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by co...@apache.org on 2017/05/03 11:52:50 UTC

[2/3] directory-kerby git commit: NPE fixes

NPE fixes


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/5e84ee43
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/5e84ee43
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/5e84ee43

Branch: refs/heads/trunk
Commit: 5e84ee43ff04b0f9e90cd80db6ec3eb33a658c9b
Parents: 9079524
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Wed May 3 12:30:55 2017 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Wed May 3 12:30:55 2017 +0100

----------------------------------------------------------------------
 .../kerberos/kdc/impl/NettyKdcServerImpl.java   | 26 +++++++++++---------
 1 file changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5e84ee43/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/impl/NettyKdcServerImpl.java
----------------------------------------------------------------------
diff --git a/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/impl/NettyKdcServerImpl.java b/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/impl/NettyKdcServerImpl.java
index 5c527f1..1ab3d5e 100644
--- a/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/impl/NettyKdcServerImpl.java
+++ b/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/impl/NettyKdcServerImpl.java
@@ -80,19 +80,23 @@ public class NettyKdcServerImpl extends AbstractInternalKdcServer {
     protected void doStop() throws Exception {
         super.doStop();
 
-        network.stop();
+        if (network != null) {
+            network.stop();
+        }
 
-        executor.shutdown();
+        if (executor != null) {
+            executor.shutdown();
 
-        try {
-            boolean terminated = false;
-            do {
-                // wait until the pool has terminated
-                terminated = executor.awaitTermination(60, TimeUnit.SECONDS);
-            } while (!terminated);
-        } catch (InterruptedException e) {
-            executor.shutdownNow();
-            LOG.warn("waitForTermination interrupted");
+            try {
+                boolean terminated = false;
+                do {
+                    // wait until the pool has terminated
+                    terminated = executor.awaitTermination(60, TimeUnit.SECONDS);
+                } while (!terminated);
+            } catch (InterruptedException e) {
+                executor.shutdownNow();
+                LOG.warn("waitForTermination interrupted");
+            }
         }
         LOG.info("Netty kdc server stopped.");
     }