From e6f99e205b1922c296486a5e23f2764f016207d1 Mon Sep 17 00:00:00 2001 From: Takanobu Asanuma Date: Tue, 6 Mar 2018 06:01:33 -0800 Subject: [PATCH] HADOOP-15291. TestMiniKdc fails on Java 9 Signed-off-by: Akira Ajisaka --- .../src/test/java/org/apache/hadoop/minikdc/TestMiniKdc.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 dafa1c1ea62..204f65666a7 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(); } }