HADOOP-15291. TestMiniKdc fails on Java 9

Signed-off-by: Akira Ajisaka <aajis...@apache.org>


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

Branch: refs/heads/HDFS-7240
Commit: e6f99e205b1922c296486a5e23f2764f016207d1
Parents: 12ecb55
Author: Takanobu Asanuma <tasan...@yahoo-corp.jp>
Authored: Tue Mar 6 06:01:33 2018 -0800
Committer: Akira Ajisaka <aajis...@apache.org>
Committed: Tue Mar 6 06:01:33 2018 -0800

----------------------------------------------------------------------
 .../src/test/java/org/apache/hadoop/minikdc/TestMiniKdc.java      | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e6f99e20/hadoop-common-project/hadoop-minikdc/src/test/java/org/apache/hadoop/minikdc/TestMiniKdc.java
----------------------------------------------------------------------
diff --git 
a/hadoop-common-project/hadoop-minikdc/src/test/java/org/apache/hadoop/minikdc/TestMiniKdc.java
 
b/hadoop-common-project/hadoop-minikdc/src/test/java/org/apache/hadoop/minikdc/TestMiniKdc.java
index dafa1c1..204f656 100644
--- 
a/hadoop-common-project/hadoop-minikdc/src/test/java/org/apache/hadoop/minikdc/TestMiniKdc.java
+++ 
b/hadoop-common-project/hadoop-minikdc/src/test/java/org/apache/hadoop/minikdc/TestMiniKdc.java
@@ -165,7 +165,8 @@ public class TestMiniKdc extends KerberosSecurityTestcase {
       loginContext.logout();
 
     } finally {
-      if (loginContext != null) {
+      if (loginContext != null && loginContext.getSubject() != null
+          && !loginContext.getSubject().getPrincipals().isEmpty()) {
         loginContext.logout();
       }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to