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 class UserGroupInformation {
@Override
public void logout() throws LoginException {
synchronized(getSubjectLock()) {
if (this.getSubject() != null
&& !this.getSubject().getPrivateCredentials().isEmpty()) {
super.logout();
}
}
}
}
/**
* A JAAS configuration that defines the login modules that we want

View File

@ -166,7 +166,7 @@ public class TestMiniKdc extends KerberosSecurityTestcase {
} finally {
if (loginContext != null && loginContext.getSubject() != null
&& !loginContext.getSubject().getPrincipals().isEmpty()) {
&& !loginContext.getSubject().getPrivateCredentials().isEmpty()) {
loginContext.logout();
}
}