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,7 +1885,10 @@ public void login() throws LoginException {
@Override
public void logout() throws LoginException {
synchronized(getSubjectLock()) {
super.logout();
if (this.getSubject() != null
&& !this.getSubject().getPrivateCredentials().isEmpty()) {
super.logout();
}
}
}
}

View File

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