HADOOP-15294. TestUGILoginFromKeytab fails on Java9

Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
This commit is contained in:
Takanobu Asanuma 2018-03-14 13:38:07 +09:00 committed by Akira Ajisaka
parent e6de10d0a6
commit fea16a440d
No known key found for this signature in database
GPG Key ID: C1EDBB9CA400FD50
2 changed files with 5 additions and 2 deletions

View File

@ -1885,10 +1885,13 @@ public void login() throws LoginException {
@Override @Override
public void logout() throws LoginException { public void logout() throws LoginException {
synchronized(getSubjectLock()) { synchronized(getSubjectLock()) {
if (this.getSubject() != null
&& !this.getSubject().getPrivateCredentials().isEmpty()) {
super.logout(); super.logout();
} }
} }
} }
}
/** /**
* A JAAS configuration that defines the login modules that we want * A JAAS configuration that defines the login modules that we want

View File

@ -166,7 +166,7 @@ public void testKerberosLogin() throws Exception {
} finally { } finally {
if (loginContext != null && loginContext.getSubject() != null if (loginContext != null && loginContext.getSubject() != null
&& !loginContext.getSubject().getPrincipals().isEmpty()) { && !loginContext.getSubject().getPrivateCredentials().isEmpty()) {
loginContext.logout(); loginContext.logout();
} }
} }