HADOOP-15294. TestUGILoginFromKeytab fails on Java9
Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
This commit is contained in:
parent
e6de10d0a6
commit
fea16a440d
@ -1885,10 +1885,13 @@ public void login() throws LoginException {
|
||||
@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
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user